Skip to content

fix: SpinButton spins forever if the first change results in a disabled button#9813

Open
snowystinger wants to merge 3 commits intomainfrom
fix-9676
Open

fix: SpinButton spins forever if the first change results in a disabled button#9813
snowystinger wants to merge 3 commits intomainfrom
fix-9676

Conversation

@snowystinger
Copy link
Member

Closes #9676

There are two approaches in this PR. The first commit made the change in useSpinButton and checked the attributes of the button being pressed. If it's disabled, stop the spin.

The second approach was a bit more systematic, I canceled the press event chain if the element was pressed but then was disabled in the pointer up event. This seems more desirable, but I am more cautious since it changes usePress.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NumberField loops if decrement/increment buttons are manually disabled in controlled component

1 participant