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

feat: 🎸 Fixes submit button, reset button, helper text behavior #84

Merged
merged 1 commit into from
Jan 26, 2021

Conversation

SeanGroff
Copy link
Contributor

Apologies for the large PR but I didn't want to split this up into multiple PR's because each would be its own version that would introduce new bugs. The re-work required all of this work to be together. Also of note, no breaking changes were needed.

This PR closes 3 issues, possibly more when I go through the issues to see if they are related.

It Fixes the submit button to be disabled when it shouldn't. Fixes the reset
button to reset to the proper initial errors state. Fixes the helper
text to always be in a correct state.

This PR doesn't affect the buttons on the Stepper component. Those buttons do not use the useSQButton hook because the Stepper component has to account for all the steps and forms as a whole.

In addition to the loom explanations, the Date picker and DateTimePicker were not properly rendering the helper text error icon when in the error state. This PR fixes that slight UI issue as well.

Looms:
https://www.loom.com/share/bb878c53cfb447c38ac144bcab0c8ef0
https://www.loom.com/share/7faa684ed86247248cd419ac7b65b026
https://www.loom.com/share/9a5d63dbaed045f3a42403b90a047298

Closes: #59, #83, #47

Fixes the submit button be disabled when it shouldn't. Fixes the reset
button to reset to the proper initial errors state. Fixes the helper
text to always be in a correct state.

✅ Closes: #59, #83, #47
@SeanGroff SeanGroff requested a review from a team January 25, 2021 18:43
Object.entries(validationSchema).reduce((acc, [key, value]) => {
if (value._exclusive?.required) {
return {...acc, [key]: 'Required'};
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be totally cool to mutate the acc here, rather than creating the new object literal and returning it. Ever so slightly more performant, arguably easier to read.

Copy link

@caleboleary caleboleary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Props on the descriptive looms. Look forward to updating to this version.

@SeanGroff SeanGroff merged commit a3a5121 into master Jan 26, 2021
@SeanGroff SeanGroff deleted the issue/59 branch January 26, 2021 14:34
@SeanGroff
Copy link
Contributor Author

🎉 This PR is included in version 2.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

SQForm submit button disabled with valid initial values
4 participants