From e33a9f28f67fc3900a24b0f8ed8628f4e7eb631a Mon Sep 17 00:00:00 2001 From: Milad Karandish <80484107+MiladKarandish@users.noreply.github.com> Date: Thu, 17 Aug 2023 12:04:10 +0330 Subject: [PATCH 1/2] In DummyInput.tsx, Input CSS hack replaced with improved and efficient code. --- .../react-select/src/internal/DummyInput.tsx | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/packages/react-select/src/internal/DummyInput.tsx b/packages/react-select/src/internal/DummyInput.tsx index 4dd19134ae..fbd2c49e16 100644 --- a/packages/react-select/src/internal/DummyInput.tsx +++ b/packages/react-select/src/internal/DummyInput.tsx @@ -25,26 +25,10 @@ export default function DummyInput({ {...filteredProps} css={{ label: 'dummyInput', - // get rid of any default styles - background: 0, - border: 0, - // important! this hides the flashing cursor - 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)', + width: '1px', + position: 'absolute', + pointerEvents: 'none', + opacity: '0', }} /> ); From 7e740a23a53dc33f0e3ba2c6b93b496a1d27e493 Mon Sep 17 00:00:00 2001 From: Milad Karandish <80484107+MiladKarandish@users.noreply.github.com> Date: Thu, 17 Aug 2023 12:29:34 +0330 Subject: [PATCH 2/2] unit test for DummyInput.tsx input test fixed --- packages/react-select/src/internal/DummyInput.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-select/src/internal/DummyInput.tsx b/packages/react-select/src/internal/DummyInput.tsx index fbd2c49e16..e27701f09d 100644 --- a/packages/react-select/src/internal/DummyInput.tsx +++ b/packages/react-select/src/internal/DummyInput.tsx @@ -29,6 +29,7 @@ export default function DummyInput({ position: 'absolute', pointerEvents: 'none', opacity: '0', + caretColor: 'transparent', }} /> );