-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
feat(textarea): ionChange will only emit from user committed changes #25953
Conversation
@@ -35,6 +35,7 @@ export class TextValueAccessorDirective extends ValueAccessor { | |||
}, | |||
], | |||
}) | |||
// TODO rename this value accessor to `TextValueAccessorDirective` when search-bar is updated |
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.
How come? Wouldn't we just get rid of the TextValueAccessorDirective
class/directive altogether and be done?
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.
Removing TextValueAccessorDirective
would introduce a breaking change to the Angular package, which we don't need to make. The "new" value accessor only exists in the span of migrating the controls to using ionInput
instead of ionChange
, then it can assume the existing name.
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.
Given <ion-textarea clear-on-edit="true" value="123"></ion-textarea>
, ionChange
does not emit when pressing backspace (After blurring).
Should ionInput
does not fire either, but that seems to be the correct behavior since Ionic is clearing the input, not the user. The current textarea does this too. (might be worth mentioning in the docs)ionInput
fire because the user pressed backspace?
@liamdebeasi couple of call outs from the last changes + feedback to your questions.
This has been fixed. This appears to be a bug in the
I do not believe so. We aren't stopping event propagation here. The default behavior with a textarea without a value, when pressing backspace, is to not emit an Other misc call outs:
|
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.
Great job!
Pull request checklist
Please check if your PR fulfills the following requirements:
ionic-docs
repo, in a separate PR. See the contributing guide for details.npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
Textarea emits
ionChange
each time thevalue
is modified internally (e.g. user typing) or externally (e.g. value being set programmatically).Issue URL: Internal
What is the new behavior?
ionChange
is only emitted when the innertextarea
change event is fired.debounce
applies to theionInput
event instead ofionChange
Does this introduce a breaking change?
Other information