projectcaluma / ember-caluma

Ember.js addons for Caluma
https://docs.caluma.io/ember-caluma/
GNU Lesser General Public License v3.0
18 stars 22 forks source link

fix(form): use ember textarea component to correctly rerender values #2728

Closed Yelinz closed 2 weeks ago

Yelinz commented 2 weeks ago

Description

When field.refreshAnswer is called a new answer value gets set. But for HTML textareas the value between the tags <textarea>foo</textarea> only acts as a default. To update the actual value one would have to update the value attribute through javascript something like element.value = "bar". This does not happend currently, the rerendering does not happend for <textarea> after refreshAnswer but for normal <input> it works.

Integration test of this always passes, no matter if its plain html textarea or ember textarea. Actually doing it over the UI in an app, causes the new value not be displayed.

Let me know if there is an better fix for this than using the ember component.

anehx commented 2 weeks ago

Passing value={{ @field.answer.value }} to the textarea is not an option?

Yelinz commented 2 weeks ago

Works, but didnt think that it would. Value is not documented to be working anywhere.

anehx commented 2 weeks ago

Interesting, you are absolutely right it is not documented.. However, since we are using this on multiple places and it works, we should use it ^^

anehx commented 2 weeks ago

:tada: This PR is included in version 12.15.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: