-
Notifications
You must be signed in to change notification settings - Fork 43
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
fix(donate): reset "other" value when switching tiers #1549
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for the described scenario, but in testing this I found another related bug that we should fix as well:
In step 3, after inputting the invalid value in "Other", switch to a different frequency tab entirely anad attempt to donate. At this point no matter what value you input the form will throw an error because the invalid input in the other Frequency tier is not focusable:
An invalid form control with name='donation_value_month_other' is not focusable. <input type="number" min="5" name="donation_value_month_other" value="25" id="newspack-tier-month-52187-other-input">
Is this error only being thrown in this branch? I think it's related to the input not being visible when other tiers are selected, not related to this PR. |
No, the bug is present on |
Aaah I see what you mean. I thought the |
Fixed in 97d5f77 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That fixes it!
## [1.75.3](v1.75.2...v1.75.3) (2023-10-10) ### Bug Fixes * **donate:** reset "other" value when switching tiers ([#1549](#1549)) ([844505f](844505f))
🎉 This PR is included in version 1.75.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Suppose a reader inputs an invalid value to the "Other" tier option and selects any other tier. In that case, the form will fail to submit due to the browser's native validation for the number input.
This PR implements a reset to the input whenever the tier selection changes, preventing the value from failing form validation.
How to test the changes in this Pull Request:
Other information: