question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

textarea: object property value cannot be changed (input works as expected)

See original GitHub issue

I have a case where <b-form-textarea /> works differently from <b-form-input /> and it’s causing issues for me in my app.

I have a component that has multiple inputs that each bind to different object properties. The value in my form is coming from a vuex store, and I’m passing it to my form component as a “computed property”. When using a <b-form-textarea v-model="value.property" /> I am unable to change the value in the <textarea>. It looks like the initial value from the object keeps overwriting whatever the user tries to input. (on each “input” event, that is) If I change the input to <b-form-input />, things go back to working as expected.

Here’s a link to a JS Bin that reproduces the bug. When trying to reproduce the issue, I did discover that not using a “computed property” caused this to behave more as expected, but the difference between input and textarea in this case still has me thinking it’s an internal bug.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
mosinvecommented, Feb 15, 2018

If you look at your example closely, you’ll see, that both b-form-input and b-form-textarea don’t set value.property. Because the whole example is wrong. This is an example of how not to write components. It’s not the bug.

2reactions
dominicbarnescommented, Jan 5, 2018

@wassansalih I’ve had to resort to using a <b-input /> instead for the time-being 😦

(the proposed solution of using a getter/setter computed property did not help me)

Read more comments on GitHub >

github_iconTop Results From Across the Web

React TextArea value not automatically updating as expected
To resolve this issue, make sure that you're passing a "non-undefined" value to the textareas value prop which will cause the textarea ...
Read more >
HTMLTextAreaElement - Web APIs | MDN
The HTMLTextAreaElement interface provides special properties and methods for ... This constraint is evaluated only when the value changes.
Read more >
lightning-input - documentation
When a field contains invalid characters, a default field-level error is displayed on blur and the value property returns an empty string. The...
Read more >
Focusing: focus/blur
This can be changed using HTML-attribute tabindex . Any element becomes focusable if it has tabindex . The value of the attribute is...
Read more >
Expressions
Property expressions; Event listener expressions; Element expressions ... Symbol values cannot be converted to strings and throw when placed in child ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found