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.

Value of textarea is not sync back to model

See original GitHub issue

Hi

If I bind model with a textarea, it works fine only if the content of textarea was modified by JavaScript:

$('#text-content').get(0).setRangeText('hi');

The model does not change after insert some text by JavaScript.

Here is an example:

http://jsfiddle.net/y6tfL/

Thanks!

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
meirlamdancommented, May 20, 2021

Here is the correct answer You will need to add

elem.dispatchEvent(new Event('input'))

0reactions
BelinChungcommented, May 18, 2015

@yyx990803 这个问题在 0.11 里面解决了? $sync 方法?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ngModel for textarea not working in angular 2 - Stack Overflow
I want to load the json object in textarea. The above code is loading the rapidPage object in textarea but its showing textarea...
Read more >
Getting and Saving Data - CKEditor 4 Documentation
In order to update the value of replaced <textarea> use the editor.updateElement() method. In rare cases it may happen that the server or...
Read more >
What you should know about Vue v-model - LearnVue
Vue v-model is a directive that creates a two-way data binding between a value in our template and a value in our data...
Read more >
CodeMirror 5 User Manual
When fromTextArea is used, and no explicit value is given for this option, it will be set to true when either the source...
Read more >
Text Area | Mendix Documentation
1 Introduction A text area is used to display and, optionally, allow the end-user to edit the value of an attribute of data...
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