Skip to content

Commit

Permalink
[base] Fix screen-reader css to avoid scrollbar
Browse files Browse the repository at this point in the history
Closes mui#40565
  • Loading branch information
brijeshb42 committed Jan 15, 2024
1 parent 9d7a370 commit dc78edf
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions packages/mui-base/src/useSelect/useSelect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
unstable_useForkRef as useForkRef,
unstable_useId as useId,
unstable_useEnhancedEffect as useEnhancedEffect,
visuallyHidden as visuallyHiddenStyle,
} from '@mui/utils';
import { useButton } from '../useButton';
import {
Expand All @@ -29,20 +30,6 @@ import { selectReducer } from './selectReducer';
import { combineHooksSlotProps } from '../utils/combineHooksSlotProps';
import { MuiCancellableEvent } from '../utils/MuiCancellableEvent';

// visually hidden style based on https://webaim.org/techniques/css/invisiblecontent/
const visuallyHiddenStyle: React.CSSProperties = {
clip: 'rect(1px, 1px, 1px, 1px)',
clipPath: 'inset(50%)',
height: '1px',
width: '1px',
margin: '-1px',
overflow: 'hidden',
padding: 0,
position: 'absolute',
left: '50%',
bottom: 0, // to display the native browser validation error at the bottom of the Select.
};

function defaultFormValueProvider<OptionValue>(
selectedOption: SelectOption<OptionValue> | SelectOption<OptionValue>[] | null,
) {
Expand Down

0 comments on commit dc78edf

Please sign in to comment.