Micro-sized & micro-optimized select component for React.js
Repo based-ghost/react-functional-select, read from GitHub 1 min ago. based-ghost has not joined Take My Repo.
menuId | string | default: undefined. The id of the menu container element - this is what is referenced as the value for the input control's aria-controls and aria-owns attributes.onKeyDown property was recieving incorrect first parameter of event.type instead of event.Effect in custom hook useCallbackRef; remove extraneous useMemo wrapper for isMenuTopPosition calculation in custom hook useMenuPositioner.empty exposed on forwarded ref to Select component.placeholder from theme object.SelectProps - equivalent can be achieved by creating new type using React.ComponentProps<typeof Select>.pageSize | number | default: 5. Number of options to jump in menu when page{up|down} keys are used.String.substr with String.startsWith (in custom useMenuOptions hook).AutosizeInput component to handle resizing via CSS + data-value attribute mapped to a psuedo element's content property. This replaces the inefficent logic consisting of a dummy node with a ref to measure the width based on input and referencing input in an useEffect and updating the actual width from the ref's calculated width. Also, removed the memo wrapper from the AutosizeInput component.memoOptions | bool | default: false - Whether to memoize each Option component. This differs from previous internal implementation which automatically memoized these components. However, after closer inspection it was clear that there was almost no UI interaction that did not trigger a rerender - making memo for these components useless and the extraneous checks on current/previous properties harmful to performance. The property exists to opt back into the legacy behavior as there is one scenario where a memoized Option component is potentially beneficial - onHover events for Option.refs, which are then used to avoid such issues).handleOnControlMouseDown() of Select.tsx component - change check from e.currentTarget.tagName to e.target.nodeName (using currentTarget only returns the element for which the event listener is attached to and we need to determine which element the mousedown event was triggered on, truly).