-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(js): Make confirm
prop of SelectField less complex
#28681
fix(js): Make confirm
prop of SelectField less complex
#28681
Conversation
6121d4d
to
7e6e852
Compare
* if the value object has a `value` attribute in the option. The types do | ||
* not correctly reflect this so be careful! | ||
*/ | ||
connfirm?: Record<string, React.ReactFragment>; |
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.
can't even name it right lol
7e6e852
to
51800fb
Compare
// Support 'confirming' selections. This only works with | ||
// `val` objects that use the new-style options format | ||
const previousValue = props.value?.toString(); | ||
const newValue = val.value?.toString(); |
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.
could the toString
here cause some weirdness when comparing values? Or is it necessary because of the constraints react-select has for string values.
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.
Yeah idk, this is copy over from what was implemented already. cc @mgaeta
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.
Sorry I don't remember why we had to add the toString()
calls.
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.
Just for future reference, would be a good time for a comment :)
51800fb
to
e63c36c
Compare
e63c36c
to
e7fa685
Compare
e7fa685
to
dc4b373
Compare
- Removes the changes made to the Confirm modal in favor of keeping that state inn the closure of the `onChange` of `openConfirmModal` - Stops _every_ SelectField from being wrapped in a `Confirm`, since most selects will not be doing confirmation. This is replaced with a simpler call to openConfirmModal.
dc4b373
to
e79ea0b
Compare
Removes the changes made to the Confirm modal in favor of keeping that state inn the closure of the
onChange
ofopenConfirmModal
Stops every SelectField from being wrapped in a
Confirm
, since most selects will not be doing confirmation. This is replaced with a simpler call to openConfirmModal.