- 
                Notifications
    You must be signed in to change notification settings 
- Fork 11
Open
Description
- If hideSelectedOptionsis set to true, all other options disappear after an option is selected. (Might be related to search functionality)
- If hideSelectedOptionsis set to false,rfs-option-selectedcss class is applied to all options after an option is selected.
- onOptionChangedoes not fire again after an option is selected. Note that this was the case when- hideSelectedOptionswas set to false, since there is currently no way to fire it twice while it is set to true afaik.
Code is pretty much like the following. If my code is wrong, feel free to let me know.
const getOptionLabel = useCallback((option: SomeObject): string => option.text, []);
const onOptionChange = useCallback((option: SomeObject | null): void => {
	console.log(option);
	if (!option) return;
	setSomeState(prevState => {
		return { ...prevState, id: option.id };
	});
}, []);
<Select
	options={someObjectArray}
	isDisabled={!!someValue}
	ref={selectRef}
	placeholder="some text"
	onOptionChange={onOptionChange}
	getOptionLabel={getOptionLabel}
	addClassNames={true}
	hideSelectedOptions={true}
	menuItemSize={30}
	blurInputOnSelect={true}
	noOptionsMsg="some text"
	themeConfig={...}
        onMenuClose={() => selectRef.current.blur()}
/>
Metadata
Metadata
Assignees
Labels
No labels