fix: choices not having choices on start

Signed-off-by: Avior <f.bouillon@aptatio.com>
This commit is contained in:
Florian Bouillon 2022-09-28 14:16:01 +02:00
parent 8d6e256fb1
commit 644cb5b1aa
Signed by: Florian Bouillon
GPG Key ID: E05B3A94178D3A7C
2 changed files with 28 additions and 0 deletions

View File

@ -52,6 +52,30 @@ tmp.args = {defaultValue : 'd', label: 'Label', helper: 'Helper', choices: [
export const AutoComplete = tmp export const AutoComplete = tmp
tmp = Input.bind({})
tmp.args = {label: 'Label', helper: 'Helper', strictChoices: true, choices: [
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'b',
{value: 'd', display: 'D'},
{value: '4', display: 'Mai'},
'cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'
], iconLeft: {
icon: X,
transformer: (v: string) => {
console.log("POUET :D")
return ""
}
}}
export const Select = tmp
tmp = Input.bind({}) tmp = Input.bind({})
tmp.args = {block: true, type: 'textarea', defaultValue : 'd', label: 'Label', helper: 'Helper', choices: [ tmp.args = {block: true, type: 'textarea', defaultValue : 'd', label: 'Label', helper: 'Helper', choices: [
'a', 'a',

View File

@ -108,6 +108,10 @@ export default class Input extends React.PureComponent<Props, States> {
}) })
} }
} }
if (this.props.choices) {
this.setState({list: this.buildList()})
}
} }
public componentWillUnmount() { public componentWillUnmount() {