-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: set value attribute on textarea instead of in content to ensure value and defaultValue stay in sync with changes #447
base: main
Are you sure you want to change the base?
Conversation
…value and defaultValue stay in sync with changes
🦋 Changeset detectedLatest commit: 34df8d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making this fix 🚀
@kmillns I'm a little confused as I am unable to re-create the error problem over here: https://ember-toucan-core.pages.dev/docs/components/textarea But your code and test look correct to me, so I've approved. |
@kmillns I'm a little confused as I am unable to re-create the error problem over here: https://ember-toucan-core.pages.dev/docs/components/textarea Yeah, I don't think it's something that would normally happen with just typing in the These screenshots show how |
Co-authored-by: nicole chung <[email protected]>
Co-authored-by: nicole chung <[email protected]>
Co-authored-by: nicole chung <[email protected]>
@@ -80,7 +80,8 @@ export default class ToucanFormTextareaControlComponent extends Component<Toucan | |||
readonly={{@isReadOnly}} | |||
...attributes | |||
{{on "input" this.handleInput}} | |||
>{{@value}}</textarea> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simonihmig I can't recall exactly why we did this initially. Do you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Let's see if @simonihmig remembers about the value change above to make sure we don't have a potential issue before merging! Thanks!
@kmillns I kicked off CI and looks like a few linting/TS errors |
Everything looks green except cloudflare publish which I think is unrelated to this PR:
|
Yeah, that'll fail since you aren't in the org. Only outstanding thing to me is #447 (review). @simonihmig do you recall? |
🚀 Description
Fixes issue #446 where the underlying
<textarea>
used inForm::Controls::Textarea
gets out of sync with@value
changes after typing in the<textarea>
.Also adds tests for both current working functionality of updating value before typing in the textarea and the previously broken case of typing in the textarea and then attempting an update of the value from outside the component.
🔬 How to Test
Added test cases should cover the functionality changing.
There's no external impact on existing examples to show.
Reversing the change in
textarea.gts
should result in one failed test case for the issue described in #446