chakra-ui-autocomplete icon indicating copy to clipboard operation
chakra-ui-autocomplete copied to clipboard

"Create " text infront of my data in dropdown field

Open FloWachter opened this issue 2 years ago • 1 comments

When updating the items={data} dynamic. I get a text in front of the data. image

FloWachter avatar Feb 11 '23 17:02 FloWachter

This happens when the items pickerItems are loaded after the component renders them.

I had to apply a conditional render to avoid that.

{pickerItems.length > 0 && (
        <CUIAutoComplete
          label=""
          placeholder="Type a Business Unit"
          onCreateItem={handleCreateItem}
          items={pickerItems}
          selectedItems={selectedItems}
          onSelectedItemsChange={changes => handleSelectedItemsChange(changes)}
          hideToggleButton={true}
        />
      )}

How did you fix?

panchicore avatar May 11 '23 19:05 panchicore