base-ui
base-ui copied to clipboard
[menu][select][composite] Skip `display: none` items
Fixes #1903
Deploy Preview for base-ui ready!
| Name | Link |
|---|---|
| Latest commit | 677ada22dceea46a96510c6fc870f8b8d263b1f9 |
| Latest deploy log | https://app.netlify.com/sites/base-ui/deploys/6822c75cfcf53a00091e9a23 |
| Deploy Preview | https://deploy-preview-1907--base-ui.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Deploy Preview for base-ui ready!
| Name | Link |
|---|---|
| Latest commit | 09235fe932ada9371675debbdc91c21269ef7718 |
| Latest deploy log | https://app.netlify.com/projects/base-ui/deploys/685164e72f2b900008ad265c |
| Deploy Preview | https://deploy-preview-1907--base-ui.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
@mj12albert @romgrk
This was my concern as well (more than the "amount" of the perf cost), that everyone will pay this cost for a pretty specific use-case
This only checks 3 items: the first item in the list, the last item, and the current item. It doesn't scale O(N)
Bundle size report
Total Size Change: 🔺+1.91KB(+0.13%) - Total Gzip Change: 🔺+472B(+0.10%) Files: 41 total (0 added, 0 removed, 10 changed)
Show details for 41 more bundles
@base-ui-components/react parsed: 🔺+380B(+0.12%) gzip: 🔺+69B(+0.07%) @base-ui-components/react/menubar parsed: 🔺+216B(+0.98%) gzip: 🔺+63B(+0.79%) @base-ui-components/react/navigation-menu parsed: 🔺+216B(+0.25%) gzip: 🔺+55B(+0.19%) @base-ui-components/react/radio-group parsed: 🔺+215B(+0.97%) gzip: 🔺+55B(+0.67%) @base-ui-components/react/tabs parsed: 🔺+215B(+0.83%) gzip: 🔺+66B(+0.72%) @base-ui-components/react/toggle-group parsed: 🔺+215B(+1.36%) gzip: 🔺+58B(+0.99%) @base-ui-components/react/toolbar parsed: 🔺+215B(+1.05%) gzip: 🔺+53B(+0.74%) @base-ui-components/react/select parsed: 🔺+85B(+0.07%) gzip: 🔺+26B(+0.07%) @base-ui-components/react/context-menu parsed: 🔺+74B(+0.07%) gzip: 🔺+14B(+0.04%) @base-ui-components/react/menu parsed: 🔺+74B(+0.06%) gzip: 🔺+13B(+0.03%) @base-ui-components/react/accordion parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/alert-dialog parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/avatar parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/checkbox parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/checkbox-group parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/collapsible parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/dialog parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/direction-provider parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/field parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/fieldset parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/form parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/input parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/merge-props parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/meter parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/number-field parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/popover parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/preview-card parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/progress parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/radio parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/scroll-area parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/separator parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/slider parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/switch parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/toast parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/toggle parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/tooltip parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/unstable-no-ssr parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/unstable-use-media-query parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/use-render parsed: 0B(0.00%) gzip: 0B(0.00%) @base-ui-components/react/utils parsed: 0B(0.00%) gzip: 0B(0.00%) Base UI checkbox parsed: 0B(0.00%) gzip: 0B(0.00%)
Generated by :no_entry_sign: dangerJS against 09235fe932ada9371675debbdc91c21269ef7718
TBH I'd just drop it. The checkVisibility function was introduced only last year in Safari, so this would lead to inconsistent results between browsers.
Also, checkVisibility returns false when an element has display: contents.