Search code examples
office-ui-fabricfluent-uifluentui-react

Fluent UI ComboBox allowFreeform


I have issues with a controlled ComboBox in fluentui from ms. I not been able to insert my own text, after insert and press enter the text disappears. The option selection works without problems.

Here a codepen: https://codepen.io/verhext/pen/jOrKOPe

 <ComboBox
    componentRef={comboBoxRef}
    defaultValue={selectedKey}
    selectedKey={selectedKey}
    label="Basic ComboBox"
    allowFreeform
    autoComplete="on"
    options={comboBoxBasicOptions}
  onChange={onChange}
/>

I don't know what I'm doing wrong in my code.
Thank you!


Solution

  • Combobox doesn't allow you to select any text value. allowFreeForm prop means that you can use manual search to select items.