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

fix(DummyInput.tsx Input): CSS hack replaced with improved and efficient code. #5727

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions packages/react-select/src/internal/DummyInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,11 @@ export default function DummyInput({
{...filteredProps}
css={{
label: 'dummyInput',
// get rid of any default styles
background: 0,
border: 0,
// important! this hides the flashing cursor
width: '1px',
position: 'absolute',
pointerEvents: 'none',
opacity: '0',
caretColor: 'transparent',
fontSize: 'inherit',
gridArea: '1 / 1 / 2 / 3',
outline: 0,
padding: 0,
// important! without `width` browsers won't allow focus
width: 1,

// remove cursor on desktop
color: 'transparent',

// remove cursor on mobile whilst maintaining "scroll into view" behaviour
left: -100,
opacity: 0,
position: 'relative',
transform: 'scale(.01)',
}}
/>
);
Expand Down