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

[core] Remove useIsFocusVisible util #42467

Open
wants to merge 10 commits into
base: next
Choose a base branch
from

Conversation

DiegoAndai
Copy link
Member

@DiegoAndai DiegoAndai commented May 31, 2024

Part of #40958

As :focus-visible is now supported in all our supported browsers (reference), we can remove this utility and rely completely on :focus-visible.

This is an intermediate step: ideally, we would use the :focus-visible pseudo-selector directly, but that would mean removing the focusVisible classes and refactoring many components.

@DiegoAndai DiegoAndai added the core Infrastructure work going on behind the scenes label May 31, 2024
@DiegoAndai DiegoAndai self-assigned this May 31, 2024
@mui-bot
Copy link

mui-bot commented May 31, 2024

Netlify deploy preview

https://deploy-preview-42467--material-ui.netlify.app/

Link: parsed: -2.54% 😍, gzip: -2.80% 😍
@mui/joy: parsed: -0.31% 😍, gzip: -0.46% 😍
@material-ui/core: parsed: -0.26% 😍, gzip: -0.38% 😍
Rating: parsed: -2.18% 😍, gzip: -2.35% 😍
@mui/joy/Switch: parsed: -1.95% 😍, gzip: -2.23% 😍
@mui/joy/Checkbox: parsed: -1.80% 😍, gzip: -2.06% 😍
@mui/joy/Radio: parsed: -1.85% 😍, gzip: -2.09% 😍
@mui/joy/Chip: parsed: -1.94% 😍, gzip: -2.02% 😍
@mui/joy/ChipDelete: parsed: -1.65% 😍, gzip: -1.82% 😍
@mui/joy/IconButton: parsed: -1.75% 😍, gzip: -1.81% 😍
@mui/joy/Button: parsed: -1.73% 😍, gzip: -1.76% 😍
@mui/joy/ListItemButton: parsed: -2.02% 😍, gzip: -1.99% 😍
@mui/joy/ModalClose: parsed: -1.61% 😍, gzip: -1.84% 😍
@mui/joy/Slider: parsed: -1.65% 😍, gzip: -1.74% 😍
@mui/joy/Tab: parsed: -1.85% 😍, gzip: -1.90% 😍
@mui/joy/MenuItem: parsed: -1.89% 😍, gzip: -1.85% 😍
@mui/joy/Autocomplete: parsed: -0.84% 😍, gzip: -1.02% 😍
@mui/joy/Option: parsed: -1.90% 😍, gzip: -1.84% 😍
Button: parsed: -17.54% 😍, gzip: -17.08% 😍
@mui/joy/Link: parsed: -1.80% 😍, gzip: -2.17% 😍
and 38 more changes

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 1dce511

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Just a precaution, have you tested that all these components behave identically once moving to use the :focus-visible pseudo selector in the oldest browsers we support? Just to make sure there won't introduce some subtle breaking changes with this.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 12, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 18, 2024
@DiegoAndai DiegoAndai marked this pull request as ready for review June 19, 2024 20:25
@DiegoAndai
Copy link
Member Author

DiegoAndai commented Jun 19, 2024

Just a precaution, have you tested that all these components behave identically once moving to use the :focus-visible pseudo selector in the oldest browsers we support? Just to make sure there won't introduce some subtle breaking changes with this.

I tested all browsers, both minimally supported and latest versions. The only thing "not working" is the Link's focus visible in Firefox 115, but that's not working on master (mui.com) either. I think it might be a configuration issue. It's working correctly on the latest Firefox version (127). So, in summary, this is working the same way as master in all supported browsers. This makes sense as we were already relying in :focus-visible on all browsers in which it was available (reference).

This is ready for review 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants