Skip to content
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

Clearing the primer-text-field's content via the clear button does not trigger an input event. #3061

Closed
dombesz opened this issue Sep 5, 2024 · 0 comments · Fixed by #3062
Labels

Comments

@dombesz
Copy link
Contributor

dombesz commented Sep 5, 2024

A good example to describe the problem is to have a primer-text-field as a search field. The search field triggers a background request to refresh the results when its value is changed. The clear button for the search field will not work the same way as manually clearing the search field's value, because it will not emit an input event. Without the input event on the #clearContents, the background request would not be triggered.

A possible workaround would be to bind the background request directly on the clear button too. Unfortunately there is no simple way to bind events to the clear button, because event binding to the clear button is not possible via the primer-text-field component declaration.

My proposed solution is to emit an input event when the clear button is pressed, please see the PR attached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant