Skip to content

Commit

Permalink
fix(picker): prevent diacritic text cutoff (#2914)
Browse files Browse the repository at this point in the history
  • Loading branch information
rise-erpelding authored Jul 19, 2024
1 parent 3002169 commit 3c3e7da
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/nasty-moose-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@spectrum-css/picker": patch
---

Changes picker margin to padding in order to accommodate text with diacritics that may be cut off vertically.
4 changes: 2 additions & 2 deletions components/picker/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@
text-overflow: ellipsis;
text-align: start;

margin-block-start: var(--mod-picker-spacing-top-to-text, var(--spectrum-picker-spacing-top-to-text));
margin-block-end: calc(var(--mod-picker-spacing-bottom-to-text, var(--spectrum-picker-spacing-bottom-to-text)) - var(--mod-picker-border-width, var(--spectrum-picker-border-width)));
padding-block-start: var(--mod-picker-spacing-top-to-text, var(--spectrum-picker-spacing-top-to-text));
padding-block-end: calc(var(--mod-picker-spacing-bottom-to-text, var(--spectrum-picker-spacing-bottom-to-text)) - var(--mod-picker-border-width, var(--spectrum-picker-border-width)));

&.is-placeholder {
font-weight: var(--mod-picker-placeholder-font-weight, var(--spectrum-picker-font-weight));
Expand Down
4 changes: 2 additions & 2 deletions components/picker/stories/picker.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ const Variants = (args) => html`
...args,
isOpen: false,
withSwitch: true,
placeholder: "Select your contry of origin",
placeholder: "Select your country of origin",
isQuiet: true,
})}
</div>
Expand All @@ -220,7 +220,7 @@ const Variants = (args) => html`
isQuiet: true,
fieldLabelStyle: {"max-width": "90px"},
label: "Enter country, text should wrap",
placeholder: "Select your contry of origin"
placeholder: "Select your country of origin"
})}
</div>
</div>
Expand Down

0 comments on commit 3c3e7da

Please sign in to comment.