-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dropdown: multiple defaultValue
& value
have incorrect types
#4017
Comments
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. |
defaultValue
& value
have incorrect type
defaultValue
& value
have incorrect typedefaultValue
& value
have incorrect types
Thanks for reporting 👍 It's the same as #4013 i.e. typings issue 😿
/** Initial value or value array if multiple. */
- defaultValue?: string | number | boolean | number | string | boolean[]
+ defaultValue?: string | number | boolean | (number | string | boolean)[] /** Current value or value array if multiple. Creates a controlled component. */
- value?: boolean | number | string | boolean | number | string[]
+ value?: boolean | number | string | (boolean | number | string)[] Would you like to a submit a PR to fix the issue? 😺 |
Just submitted one, can't get past the label checks though haha |
@layershifter Hi! Any news on this? I'd really like to update to newer version of the lib. |
@xumix released in |
Thanks a lot! |
Bug Report
Just stumbled across this - not sure if it's a bug or an user error.
Steps
A clear and concise description of steps to reproduce the problem.
Reproduce:
<Dropdown placeholder="Add tags" fluid multiple selection options={this.state.allTagsFormatted} onChange={this.handleTagChange} defaultValue={['VALUE1', 'VALUE2']} />
Where this.state.allTagsFormatted is an array of type
key: string; text: string; value: string; created_date: string;
And passing an array of strings of options values into the defaultValue prop. Example: ['1111','2222', ...]
Expected Result
The result that you expected.
Compiles and pass type check per the docs:
`
`
Actual Result
The actual result that happened 💣
Throws this typescript error:
Type 'string' is not assignable to type 'boolean'
Version
semantic-ui-react : "^1.1.0",
"typescript": "^3.9.7"
"@craco/craco": "^5.6.4",
"@semantic-ui-react/craco-less": "^1.2.1",
"semantic-ui-less": "^2.4.1"
Testcase
The text was updated successfully, but these errors were encountered: