Open pd2xts opened 2 months ago
Using the example below:
The control will not accept focus and no caret is visible, entering text is not possible.
To be able to enter text again, user must click elsewhere to blur the control and then click back into it.
If openMenuOnClick is true then this problem does not occur.
openMenuOnClick
true
import React, { useState } from "react"; import Select from "react-select"; export default function App() { const [selectedOption, setSelectedOption] = useState("none"); const options = [ { value: "option1", label: "Option 1" }, { value: "option2", label: "Option 2" }, { value: "option3", label: "Option 3" }, ]; const handleTypeSelect = (e) => { setSelectedOption(e ? e.value : e); }; return ( <div> <Select options={options} onChange={handleTypeSelect} value={options.filter(function (option) { return option.value === selectedOption; })} label="Single select" isClearable openMenuOnClick={false} /> </div> ); }
Using the example below:
The control will not accept focus and no caret is visible, entering text is not possible.
To be able to enter text again, user must click elsewhere to blur the control and then click back into it.
If
openMenuOnClick
istrue
then this problem does not occur.