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

Dispatches 'change' event when the field type is a number #157

Conversation

mattsears
Copy link
Contributor

Hi folks!

First wanted to say thanks for your great work on this project. I'm using these components in my current project and I have a use case where I have a form that auto-saves when the user enters data via 'keyup' or 'change' events. In the case of a number text field, such as:

<%= polaris_text_field(
  name: :quantity,
  value: 1.34,
  type: :number,
) %>

When the user increases or decreases the number by clicking on the up or down arrows, there is no change event triggered so my form doesn't know to save.

This PR dispatches 'change' event when the field type is a number and the value is changed by increasing or decreasing the value via the up and down arrows on the field allowing me to capture the event and handle it accordingly.

…ue is changed by increasing or decreasing the value via the up and down arrows on the field.
@kirillplatonov kirillplatonov merged commit 0efb1af into baoagency:main Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants