Open ghost opened 11 years ago
yes, via css:
.mytextarea {
width: 200px;
}
and then
editable({
inputclass: 'mytextarea'
});
How to make textarea 100% of parent ? Settings that you posted wont shrink textarea. So it breaks bootstrap responsive grid, because textarea is fixed with 200px width
Just use relative sizes.
.mytextarea {
width: 100%;
}
@chall8908 It doesen't work. Tried it already. X-editable is breaking default bootstrap sizing. Because if you will look in docs there is said:
Individual form controls automatically receive some global styling. All textual ,
And here is example: http://getbootstrap.com/css/#forms
I don't know why inline mode does not show textarea in 100% width. There are various custom css flags, that breaks that 100% funcionality. I will try to rewrite global template and see if it helps...
So, after research, in inline mode, if i remove class "form-inline" in global template and also override styles
.editable-container.editable-inline {
display: inline;
}
.editable-input {
display: inline;
}
.editableform .form-control {
width: 100%;
}
Form expands 100% like it should.
@ddctd143 I'll have to keep this in mind. I use inline mode pretty exclusively and I imagine I'll run into this at some point.
If you want to avoid editing the global templates (as I do), you could add a few lines of javascript to remove the form-inline class from the from...
$('#task_description').on('shown', function(e, editable) {
$('.editable_large').parents('form').removeClass('form-inline');
});
using ddctd143's approach did get the textarea to be 100% but it broke the cancel button and when you press blue check button loading graphic would just hang and spin
this is what worked for me:
.editable-buttons {
display: block;
}
.editable-container.editable-inline, .editableform > .control-group, .editable-input, .editableform .form-control {
width:100%;
}
UPDATE: changing this in the css did it:
.editable-wrap{display:inline-block;white-space:nowrap;margin:0;width:100%;}.editable-wrap .editable-controls,.editable-wrap .editable-error{margin-bottom:0;width:100%;}
Hi all,
After an embarrassing amount of hours trying to make 100% the width of a textarea, I need your help...
I have tried all the options above and none works. My code is the following:
<div class='container'>
<div class="row">
<div class="col-md-8">
<a href="#" editable-textarea="obj.text" e-style="width: 100%">{{ obj.text || "empty" }}</a>
</div>
</div>
</div>
I use Bootstrap 3.
Any hint on how to make this text area to be 100% width with respect the "col-md-8" where it is contained??
Thanks a lot!
This works for me
.editable-wrap {
display: block;
}
.editable-controls input {
width: 100%;
}
This make all xeditable inputs take available width.
Another solution:
.editable-container.editable-inline,
.editable-container.editable-inline .control-group.form-group,
.editable-container.editable-inline .control-group.form-group .editable-input,
.editable-container.editable-inline .control-group.form-group .editable-input textarea,
.editable-container.editable-inline .control-group.form-group .editable-input select,
.editable-container.editable-inline .control-group.form-group .editable-input input:not([type=radio]):not([type=checkbox]):not([type=submit])
{
width: 100%!important;
}
My solution:
.editable-wrap {
display: inline-block;
white-space: nowrap;
margin: 0;
width: 100%; //
}
.editable-wrap .editable-controls, .editable-wrap .editable-error {
margin-bottom: 0;
width: 100%;
}
.editable-wrap .editable-controls>select {
margin-bottom: 0;
}
.editable-wrap .editable-controls>input, .editable-wrap .editable-controls>textarea {
margin-bottom: 0;
width: -moz-calc(100% - 76px);
width: -webkit-calc(100% - 76px);
width: calc(100% - 76px);
}
@lukaszbanasiak. Thank you for posting your solution. It worked great!
how do i make editable-wrap only apply to some input boxes?
I merged @Relequestual JS with @ddctd143 HTML and added class to put everything inside, thanks to which you can select to what fields will it be applied and also modernise the CSS classes. I also added padding for buttons.
My complete solution if somebody would be interested: CSS:
/* bootstrap-xeditable occupy 100% of space */
.textarea_modal_widget .editable-container.editable-inline {
display: block;
}
.textarea_modal_widget .editable-input {
display: inline;
}
.textarea_modal_widget .editable-buttons {
padding-top: 10px;
}
JS:
$('#comment').on('shown', function(e, editable) {
$('.textarea_modal_widget .input-large').parents('form').removeClass('form-inline');
});
HTML:
<div class="textarea_modal_widget"><a href="#" id="comment" data-type="textarea" data-pk="1" ...>
SOMETHING LITTLE LONGER</a></div>
UPDATE: there are really weird bugs with buttons e.g.:
Add these css:
.editable-container div,.editable-container form{min-width:100%!important;display:block!important;} .editable-container.editable-inline{display:block;}
Is there a way for us to size a specific textarea width in a inline or popover edit mode? Yet allowing the textarea to stretch if needed?