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

Instance resize modal submit button doesn't enable until you blur the input #2647

Open
david-crespo opened this issue Jan 9, 2025 · 2 comments
Labels

Comments

@david-crespo
Copy link
Collaborator

2025-01-09-resize-input-blur.mp4
@benjaminleonard
Copy link
Contributor

benjaminleonard commented Jan 9, 2025

I believe this is due to how the react-aria number input works. It takes the value in the input and applies it on blur. Though maybe if the submit button is enabled when the input is touched it would still submit (and update the number value)?

Edit:
https://react-spectrum.adobe.com/react-aria/NumberField.html#value

The onChange event is triggered whenever the number value updates. This happens when the user types a value and blurs the input, or when incrementing or decrementing the value. It does not happen as the user types because partial input may not be parseable to a valid number.

@david-crespo
Copy link
Collaborator Author

david-crespo commented Jan 9, 2025

If it's hard to fix on the input side, I lean toward leaving the button enabled and having it refuse to submit if the values haven't changed. Might as well enable it to begin with if it's going to be enabled on touch. We could also hack something into the field's onChange to enable the button.

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

No branches or pull requests

2 participants