mui / mui/base-ui

[slider] Migrate to use .focus({ focusVisible: false }) once available

Open
#2,592 1 comment 0 reactions 0 assignees View on GitHub
component: popover component: slider on hold performance type: enhancement
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

## Current behavior

Because of this annoying default behavior of the platform: https://github.com/w3c/csswg-drafts/issues/5885. We had to add this defer logic: https://github.com/mui/base-ui/blob/a2360dfacdaf8e410ebe558c2f8fc4e3d9078b37/packages/react/src/slider/control/SliderControl.tsx#L391-L393

## Expected behavior

It would be better for bundle size, code complexity, to remove this (remove the extra code, remove the `waitFor()` in the tests, etc.). Instead it would be ideal to use https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#focusvisible.

But it's **on hold** for now, we are waiting for enough browser support https://caniuse.com/mdn-api_htmlelement_focus_options_focusvisible_parameter. Chromium is the biggest offender, the implementation request: https://issues.chromium.org/issues/40834435.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.