Skip to content

Commit

Permalink
fix(Select): traditional placeholder prop used (#944)
Browse files Browse the repository at this point in the history
* fix(Select): traditional placeholder prop used

* chore: changset
  • Loading branch information
billgil authored Dec 12, 2022
1 parent 8e31f59 commit 59b1215
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-crabs-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@web3uikit/core': patch
---

Select: traditional placholder prop used
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useEffect, useState } from 'react';
import TraditionalSelectStyles from './TraditionalSelect.styles';
import { SelectProps } from '../types';
import { ISelectProps } from '../types';
import InputStyles from '../../Input/Input.styles';
const { DivWrapperStyled, LabelStyled: LabelStyledTrad } = InputStyles;
const { DivStyledDescription, SelectStyled } = TraditionalSelectStyles;

const TraditionalSelect: React.FC<SelectProps> = ({
const TraditionalSelect: React.FC<ISelectProps> = ({
customNoDataText = 'No Data',
defaultOptionIndex,
description,
Expand All @@ -17,6 +17,7 @@ const TraditionalSelect: React.FC<SelectProps> = ({
onChange,
onChangeTraditional,
options = [],
placeholder,
prefixIcon,
prefixText,
ref,
Expand All @@ -28,7 +29,7 @@ const TraditionalSelect: React.FC<SelectProps> = ({
value,
width = '200px',
...props
}: SelectProps) => {
}: ISelectProps) => {
const [selectedOptionIndex, setSelectedOptionIndex] =
useState(defaultOptionIndex);

Expand All @@ -52,7 +53,7 @@ const TraditionalSelect: React.FC<SelectProps> = ({
>
<SelectStyled
data-testid="test-select-select"
defaultValue="Please choose"
defaultValue={placeholder || 'Please choose'}
id={id}
ref={refTraditional}
onChange={(event: React.ChangeEvent<HTMLSelectElement>) =>
Expand All @@ -68,7 +69,7 @@ const TraditionalSelect: React.FC<SelectProps> = ({
(option, i) =>
i !== selectedOptionIndex && (
<option
data-testid={`test-seclect-option-${i}`}
data-testid={`test-select-option-${i}`}
id={String(option?.id)}
key={option?.id}
>
Expand Down

0 comments on commit 59b1215

Please sign in to comment.