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

[docs] Use Base UI Portal for the quick filter recipe #10188

Merged
merged 3 commits into from
Sep 5, 2023

Conversation

DanailH
Copy link
Member

@DanailH DanailH commented Aug 31, 2023

Based on #10121 (comment)

@mui-bot
Copy link

mui-bot commented Aug 31, 2023

Netlify deploy preview

Netlify deploy preview: https://deploy-preview-10188--material-ui-x.netlify.app/

Updated pages

No updates.

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms -211.5 79.4 -68.6 -69.84 105.038
Sort 100k rows ms 782.9 1,480.3 1,480.3 1,112.6 247.079
Select 100k rows ms 586.9 765.6 681.3 690.74 65.09
Deselect 100k rows ms 130.1 276.1 203.7 206.04 47.405

Generated by 🚫 dangerJS against 19c240d

<GridToolbarQuickFilter />,
document.getElementById('filter-panel'),
)}
<Portal container={() => document.getElementById('filter-panel')}>
Copy link
Member

@MBilalShafi MBilalShafi Sep 4, 2023

Choose a reason for hiding this comment

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

Is using the function-based selector needed here, could we directly use the selector here?

Suggested change
<Portal container={() => document.getElementById('filter-panel')}>
<Portal container={document.getElementById('filter-panel')}>

As per docs:
image

Copy link
Member

Choose a reason for hiding this comment

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

It would break during server side rendering, I guess.

<GridToolbarQuickFilter />,
document.getElementById('filter-panel')!,
)}
<Portal container={() => document.getElementById('filter-panel')}>
Copy link
Member

Choose a reason for hiding this comment

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

I have doubt about the types in https://github.com/mui/material-ui/blob/ffa4751a513cee56a8cd069c788a209d8beae7c7/packages/mui-base/src/Portal/Portal.types.ts#L15. This feels so strange. Why should it allow <Portal container={() => null}>

Suggested change
<Portal container={() => document.getElementById('filter-panel')}>
<Portal container={() => document.getElementById('filter-panel')!}>

<GridToolbarQuickFilter />,
document.getElementById('filter-panel'),
)}
<Portal container={() => document.getElementById('filter-panel')}>
Copy link
Member

Choose a reason for hiding this comment

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

It would break during server side rendering, I guess.

….tsx

Co-authored-by: Olivier Tassinari <[email protected]>
Signed-off-by: Danail Hadjiatanasov <[email protected]>
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.

4 participants