Home > OS >  how to close the dropdown after selection antd
how to close the dropdown after selection antd

Time:04-18

Goal: Close the dropdown after selecting the option. This works on normal select dropdown but not while in tags.

Code:

 <Select
    mode="multiple"
    style={{ width: "100%" }}
    placeholder="select one country"
    defaultValue={["china"]}
    onChange={handleChange}
    optionLabelProp="label"
  >
    <Option value="china" label="China">
      <div className="demo-option-label-item">
        <span role="img" aria-label="China">
                     
  • Related