diff --git a/src/Input/Input.stories.tsx b/src/Input/Input.stories.tsx index 519790f..de24de6 100644 --- a/src/Input/Input.stories.tsx +++ b/src/Input/Input.stories.tsx @@ -52,6 +52,30 @@ tmp.args = {defaultValue : 'd', label: 'Label', helper: 'Helper', choices: [ 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.args = {block: true, type: 'textarea', defaultValue : 'd', label: 'Label', helper: 'Helper', choices: [ 'a', diff --git a/src/Input/index.tsx b/src/Input/index.tsx index 5a957f0..42629a0 100644 --- a/src/Input/index.tsx +++ b/src/Input/index.tsx @@ -108,6 +108,10 @@ export default class Input extends React.PureComponent { }) } } + + if (this.props.choices) { + this.setState({list: this.buildList()}) + } } public componentWillUnmount() {