angular-xeditable icon indicating copy to clipboard operation
angular-xeditable copied to clipboard

How to change the input size?

Open xinyu7git opened this issue 11 years ago • 10 comments

the default input text size is to short,how to increase my input text size?

image

xinyu7git avatar Jun 23 '15 09:06 xinyu7git

not the nicest, but the easiest way would be to use e-style attribute.

<span editable-text="user.name" e-name="name" e-style="width:400px;" onbeforesave="doSomething($data)" </span>

m-apsolon avatar Jun 24 '15 10:06 m-apsolon

@m-apsolon thank you ~

xinyu7 avatar Jul 02 '15 14:07 xinyu7

If you're going to do a lot of them and/or several other modifications, you could add a supplemental style sheet. A later style setting will override a previous one of the same weight, so make sure your custom style sheet loads last.

innerpeace0 avatar Jul 02 '15 16:07 innerpeace0

Could we do a responsive size? Thanks.

boubou1030 avatar Jul 28 '15 07:07 boubou1030

Perhaps a percentage?

innerpeace0 avatar Jul 28 '15 07:07 innerpeace0

I mad this change direct into the css (by the way, I'm using sass), in this part here:

.editable-wrap {
    display:block;
    width: 100%;
    padding-right:10px;
    .editable-controls {
        > input,
        > select,
        > textarea {
            display: inline-block;
            width: 100%;
        }
    }
}

Hope this is what you are looking for.

Edit: This will override the main style, so every editable will have this style. If you want to apply this to just one page or one form, you can follow @innerpeace0 response, and create your own style to change it.

celsomtrindade avatar Jul 28 '15 11:07 celsomtrindade

@innerpeace0 I used a percentage and the size can be changed, but however it didn't show a responsive size. @celsomtrindade I don't have any experience on sass, I'm wondering how could I modify it into css3 between directly? Thanks!

boubou1030 avatar Jul 28 '15 16:07 boubou1030

It would be something like this:

.editable-wrap {
    display:block;
    width: 100%;
}
.editable-wrap .editable-controls > input,
.editable-wrap .editable-controls > select,
.editable-wrap .editable-controls > textarea {
    display: inline-block;
    width: 100%;
}

But like i said, this is the default css and i did this modification to match my layout, maybe you need to change some things to match yours, but you'll get the idea.

celsomtrindade avatar Jul 28 '15 16:07 celsomtrindade

@celsomtrindade Thank you very much! I'm looking into it.

boubou1030 avatar Jul 29 '15 07:07 boubou1030

Did you try to use the ### inline-size property of an input text in CSS or the ### size property it's doing the effect for me.

EnsiasStudent avatar Jun 24 '19 10:06 EnsiasStudent