Skip to content

Commit

Permalink
fix: replace 'value' with 'defaultValue' of the hidden select in List…
Browse files Browse the repository at this point in the history
…box component to remove a warning since it is a read only field.
  • Loading branch information
Roman Glombovsky committed Sep 28, 2023
1 parent 58ba1d6 commit 13a8a2d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/ebay-listbox-button/__tests__/__snapshots__/index.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ exports[`Storyshots ebay-listbox-button Borderless 1`] = `
</button>
<select
className="listbox-button__native"
defaultValue="BB"
hidden={true}
value="BB"
>
<option
value="AA"
Expand Down Expand Up @@ -87,8 +87,8 @@ exports[`Storyshots ebay-listbox-button Default - no selected option 1`] = `
</button>
<select
className="listbox-button__native"
defaultValue="AA"
hidden={true}
value="AA"
>
<option
value="AA"
Expand Down Expand Up @@ -148,8 +148,8 @@ Array [
</button>
<select
className="listbox-button__native"
defaultValue="BB"
hidden={true}
value="BB"
>
<option
value="AA"
Expand Down Expand Up @@ -200,8 +200,8 @@ exports[`Storyshots ebay-listbox-button Default 1`] = `
</button>
<select
className="listbox-button__native"
defaultValue="BB"
hidden={true}
value="BB"
>
<option
value="AA"
Expand Down Expand Up @@ -252,8 +252,8 @@ exports[`Storyshots ebay-listbox-button Disabled State 1`] = `
</button>
<select
className="listbox-button__native"
defaultValue="BB"
hidden={true}
value="BB"
>
<option
value="AA"
Expand Down Expand Up @@ -309,8 +309,8 @@ exports[`Storyshots ebay-listbox-button Floating label 1`] = `
</button>
<select
className="listbox-button__native"
defaultValue="AA"
hidden={true}
value="AA"
>
<option
value="AA"
Expand Down Expand Up @@ -360,8 +360,8 @@ exports[`Storyshots ebay-listbox-button Fluid 1`] = `
</button>
<select
className="listbox-button__native"
defaultValue="BB"
hidden={true}
value="BB"
>
<option
value="AA"
Expand Down Expand Up @@ -412,8 +412,8 @@ exports[`Storyshots ebay-listbox-button Invalid State 1`] = `
</button>
<select
className="listbox-button__native"
defaultValue="BB"
hidden={true}
value="BB"
>
<option
value="AA"
Expand Down Expand Up @@ -464,8 +464,8 @@ exports[`Storyshots ebay-listbox-button Statefull component 1`] = `
</button>
<select
className="listbox-button__native"
defaultValue="California"
hidden={true}
value="California"
>
<option
value="California"
Expand Down Expand Up @@ -540,8 +540,8 @@ exports[`Storyshots ebay-listbox-button Too many options 1`] = `
</button>
<select
className="listbox-button__native"
defaultValue="BB"
hidden={true}
value="BB"
>
<option
value="AA"
Expand Down
2 changes: 1 addition & 1 deletion src/ebay-listbox-button/listbox-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ const ListboxButton: FC<EbayListboxButtonProps> = ({
{updatelistBoxButtonOptions}
</div>
</div>}
<select hidden className="listbox-button__native" name={name} value={selectedOption.props.value}>
<select hidden className="listbox-button__native" name={name} defaultValue={selectedOption.props.value}>
{
updatelistBoxButtonOptions.map((option, i) =>
<option value={option.props.value} key={i} />)
Expand Down

0 comments on commit 13a8a2d

Please sign in to comment.