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
[TextField] Add the event
argument to the onBlur
prop
#6143
Conversation
092ab74
to
8756c99
Compare
onFocus?: (event?: React.FocusEvent<HTMLElement>) => void; | ||
/** Callback fired when focus is removed */ | ||
onBlur?(): void; | ||
onFocus?: (event?: React.FocusEvent) => void; |
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.
I know it's not technically part of this PR but wondering why the onFocus
has a optional event
in the parameters. Shouldn't it always be there?
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.
Huh, good call I'm not sure 🤔
8756c99
to
10f1b19
Compare
10f1b19
to
151f9a5
Compare
size-limit report 📦
|
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.
lgtm! Thanks for the quick fix @chloerice!
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.
🎉
…#6224) * [TextField] Reverts onFocus event arg not being optional * [TextField] Make onBlur event optional
WHY are these changes introduced?
Fixes #6115
WHAT is this pull request doing?
Callbacks set on the
TextField
onBlur
prop had to hack around the lack of support for theevent
argument passed implicitly by theinput
prior to shipping #5957. This PR fixes regressions upstream inweb
by adding and passing theevent
argument to theonBlur
prop so that consuming apps don't need to hack their callback's types when composing complex inputs likeDatePickerTextField
.How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Copy-paste this code in
playground/Playground.tsx
:🎩 checklist
README.md
with documentation changes