Skip to content

Commit

Permalink
FIX: label text overlap for selected option (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
guilherme-n authored Oct 16, 2023
1 parent 328c5bb commit 0f97830
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ exports[`Storyshots ebay-listbox-button Floating label 1`] = `
>
Select
</span>
<span
className="btn__text"
>
-
</span>
<svg
aria-hidden={true}
className="icon icon--chevron-down-16"
Expand Down
8 changes: 3 additions & 5 deletions src/ebay-listbox-button/listbox-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,10 @@ const ListboxButton: FC<EbayListboxButtonProps> = ({
})
const expandBtnTextId = prefixId && 'expand-btn-text'

const buttonLabel = floatingLabel ? (
<span className="btn__floating-label">
{floatingLabel}
</span>
) : (

const buttonLabel = (
<>
{floatingLabel && <span className="btn__floating-label">{floatingLabel}</span>}
{prefixLabel && <span className="btn__label">{prefixLabel}</span>}
<span className="btn__text" id={expandBtnTextId}>
{selectedOption?.props.children || unselectedText}
Expand Down

0 comments on commit 0f97830

Please sign in to comment.