diff --git a/lib/Select/Select.test.tsx b/lib/Select/Select.test.tsx index e07a79a..cdcf43d 100644 --- a/lib/Select/Select.test.tsx +++ b/lib/Select/Select.test.tsx @@ -1005,7 +1005,7 @@ describe("Select", () => { }); expect(handleSubmit.mock.calls.length).toBe(2); - expect(getFormData().getAll("n")).toEqual(["1"]); + expect(getFormData().getAll("n")).toEqual(["0", "1"]); rerender1(
{ }); expect(handleSubmit.mock.calls.length).toBe(2); - expect(getFormData().get("n")).toBe(null); + expect(getFormData().get("n")).toBe("0"); rerender2( ) => { closeList(); } - const getOptions = () => getOptionsUtil(React.Children.toArray(children)); - const context: SelectContextValue = { readOnly, disabled, @@ -433,7 +426,6 @@ const SelectBase = (props: Props, ref: React.Ref) => { closeListAndMaintainFocus, setFilteredEntities, setActiveDescendant, - getOptions, openList, closeList, toggleList, @@ -491,29 +483,14 @@ const SelectBase = (props: Props, ref: React.Ref) => { if (selectedValues.length === 0) return null; const renderOptions = () => { - const disabledOptions = getOptions().filter(o => o.disabled); - - const isOptionDisabled = (optionValue: string) => - disabledOptions.some(o => o.value === optionValue); - - if (!multiple) { - const optionValue = selectedValues as string; - - if (isOptionDisabled(optionValue)) return null; - - return