Skip to content

Commit

Permalink
fix: input contents are moved to the left due to space char (#4823)
Browse files Browse the repository at this point in the history
* fix: input was moved to the left due to space char

* chore: add changeset file

* fix: input display on a new line when using multi select

* fix: change whitespace from `nowrap` to `pre` to preserve whitespace
  • Loading branch information
quanphm authored Oct 5, 2021
1 parent 8b38d49 commit 0937604
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-timers-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-select': patch
---

Fix the issue where input contents are moved to the left due to multiple space characters.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ exports[`defaults - snapshot 1`] = `
.emotion-6:after {
content: attr(data-value) " ";
visibility: hidden;
white-space: nowrap;
white-space: pre;
grid-area: 1/2;
font: inherit;
min-width: 2px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ exports[`defaults - snapshot 1`] = `
.emotion-6:after {
content: attr(data-value) " ";
visibility: hidden;
white-space: nowrap;
white-space: pre;
grid-area: 1/2;
font: inherit;
min-width: 2px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ exports[`defaults - snapshot 1`] = `
.emotion-6:after {
content: attr(data-value) " ";
visibility: hidden;
white-space: nowrap;
white-space: pre;
grid-area: 1/2;
font: inherit;
min-width: 2px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ exports[`snapshot - defaults 1`] = `
.emotion-6:after {
content: attr(data-value) " ";
visibility: hidden;
white-space: nowrap;
white-space: pre;
grid-area: 1/2;
font: inherit;
min-width: 2px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ exports[`defaults > snapshot 1`] = `
.emotion-6:after {
content: attr(data-value) " ";
visibility: hidden;
white-space: nowrap;
white-space: pre;
grid-area: 1/2;
font: inherit;
min-width: 2px;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-select/src/components/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const containerStyle = {
'&:after': {
content: 'attr(data-value) " "',
visibility: 'hidden',
whiteSpace: 'nowrap',
whiteSpace: 'pre',
...spacingStyle,
},
} as const;
Expand Down

0 comments on commit 0937604

Please # to comment.