-
Notifications
You must be signed in to change notification settings - Fork 538
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
SelectPanel2: 3 tiny bug fixes #3770
Conversation
|
size-limit report 📦
|
Just wanted to ask, is it possible for |
This reverts commit 02901a8.
I think so, i have a rough idea. But, I might be wrong. Will find out, I guess :) |
if (typeof props.onCancel === 'function') props.onCancel() | ||
} | ||
// @ts-ignore todo | ||
const onInternalSubmit = event => { | ||
event.preventDefault() | ||
if (props.open === 'undefined') setInternalOpen(false) | ||
if (props.open === undefined) setInternalOpen(false) |
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 think you fixed it in the other PR, no? #3770
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.
This is that PR :)
I've put it in both PRs, but I intent to merge this PR first and then #3764
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.
This is that PR :)
🙈
@@ -105,7 +105,7 @@ const SelectPanel = props => { | |||
{slots.header || <SelectPanel.Header />} | |||
{childrenInBody} | |||
{/* render default footer as fallback */} | |||
{slots.footer || <SelectPanel.Footer />} | |||
{slots.footer} |
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 forgot that we would need to add Suspense support to useSlots first before making footer optional.
This is probably my ignorance but what is the reason of wrapping the footer in Suspense? 🤔
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.
If we need to fetch data before rendering the list, we'd like the footer to also be hidden until then.
So it's wrapped in the same Suspense boundary as list
Screen.Recording.2023-09-28.at.4.01.41.PM.mov
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.
Ahh that makes sense!!
Fix 1
In #3758, I forgot that we would need to add Suspense support to
useSlots
first before making footer optional. Default header is fine because it can't be wrapped in suspense, but footer totally can be.Haven't tried to update useSlots yet, will explore later.
Fix 2
The menu was not closing on it's own because I made a silly mistake. We will be able to catch these silly things once I write some tests 😅
Fix 3
Added a warning to the ActionMenu story because it's implementation will most definitely change once we implement SelectPanel as a modal