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

In DummyInput.tsx, Input CSS hack replaced with improved and efficient code. https://github.com/JedWatson/react-select/issues/5722 #5727

Open
wants to merge 3 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 4 additions & 19 deletions packages/react-select/src/internal/DummyInput.tsx
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