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

Save bar doesn't show when updating form.polaris_text_field type: :number value using stepper arrows #449

Open
BaggioGiacomo opened this issue Sep 24, 2024 · 0 comments

Comments

@BaggioGiacomo
Copy link

BaggioGiacomo commented Sep 24, 2024

You can add the save bar by adding data-save-bar=true on the form (more info here)
If you add a form with a numeric input type (form.polaris_text_field type: :number) it works correctly if changing the value by writing a new number manually. If you update the value using the stepper arrows, the save bar doesn't appear

The problem here is that the event is actually fired but bubbles property is missing.

Here's a workaround to temporary fix this:

input.addEventListener("change", (event) => {
  if (!event.bubbles) {
    input.dispatchEvent(
      new Event("change", {
        bubbles: true,
      })
    );
  }
});
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

No branches or pull requests

1 participant