Can't type in b-form-textarea
See original GitHub issueI’m trying to use textarea in my component, but I can’t type in text. Sometimes I was able to type one letter but nothing more. The same code but with b-form-input -works. I can type a text there but in textarea - can’t
I’m using textarea in tabs:
<b-tab v-for="(item, index) in newItem" :key="item.code" :title="item.name" :active="!index">
<!--Input works-->
<b-form-input id="InfoInput"
type="text"
v-model="item.value.info">
</b-form-input>
<!--Text area does not work-->
<b-form-textarea id="countryInfo"
v-model="item.value.info"
:rows="3">
</b-form-textarea>
</b-tab>
OS: Ubuntu 16.4 Browser: Google Chrome Version of Bootstrap-Vue: 2.0.0-rc.2
Issue Analytics
- State:
- Created 5 years ago
- Reactions:13
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Form Textarea | Components - BootstrapVue
Create multi-line text inputs with support for auto height sizing, minimum and maximum number of rows, and contextual validation states.
Read more >Customizing a <b-form-textarea> with label and invalid message
First can you tell me where you see the invalidFeedback property. I can't find it in the docs for b-form-input. The label you...
Read more >Form Textarea | BootstrapVue 3 - cdmoro
Form Textarea. Create multi-line text inputs with support for auto height sizing, minimum and maximum number of rows, and contextual states.
Read more >The Textarea element - HTML: HyperText Markup Language
This attribute enables you to place <textarea> elements anywhere within a document, not just as descendants of form elements. maxlength. The ...
Read more >Bootstrap Textarea input free examples, templates & tutorial
A Bootstrap Textarea is an input dedicated to a large volume of text. It may be used in a variety of components like...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Proposed fix:
In bootstap-vue.js, in the section
var bFormTextarea = ...
change the following:Replace with:
This seems to correct the problem.
Notes:
Nature of the problem is not not being able to type into the textarea because the value is immediately refreshed with the old value. (i.e. the control is not read-only, but flickers and overwrites what you type).
This fix is patterned after the way bFormInput is coded (see onInput() and setValue() methods of bFormInput).
Note that the input event fires on every keystroke.
Before the fix, inspecting evt.target.value shows that the evt.target.value does contain the correct value (i.e. the current value of the text area, including the latest typed character), but the setter on localValue looses the new character that was typed…specifically in vue.js at
dep.notify();
infunction reactiveSetter()
… specifically in vue.js atDep.prototype.notify = function notify ()...subs[i].update();
After the fix, the control behaves properly.
I am not sure why this work, but a workaround for me was to initialize the object specified in v-model (in this cacse “info”) through Vue.set(). I think the issue is something to do with the vue observability.