Skip to content

Releases: based-ghost/react-functional-select

v4.1.0

30 Nov 02:10
Compare
Choose a tag to compare

Change Log

🚀 Feature

  • New property: 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.

🐞 Bugfix

  • onKeyDown property was recieving incorrect first parameter of event.type instead of event.

v.4.0.1

26 Nov 20:48
Compare
Choose a tag to compare

Change Log

🛠 Misc

  • Remove extraneous dep list from Effect in custom hook useCallbackRef; remove extraneous useMemo wrapper for isMenuTopPosition calculation in custom hook useMenuPositioner.

v4.0.0

23 Nov 21:43
Compare
Choose a tag to compare

Change Log

💥 Breaking Changes

  • Removal of property empty exposed on forwarded ref to Select component.
  • Removal of key placeholder from theme object.
  • No longer exporting type SelectProps - equivalent can be achieved by creating new type using React.ComponentProps<typeof Select>.

🚀 Feature

  • New property: pageSize | number | default: 5. Number of options to jump in menu when page{up|down} keys are used.

🐞 Bugfix

  • Fix issue in Chrome browser where detection of touch-enabled devices was not working properly.
  • Replace deprecated String.substr with String.startsWith (in custom useMenuOptions hook).

🛠 Misc

  • Large internal rewrite that accomplishes: 1). large performance boost; 2). reduction in code/bundle size of package. Changes focused on removing logic from useEffects and moving it to memoized functions (that way updates happen quicker and are not occurring after previous renders - and causing additional renders). Additionally, dependency lists were trimmed by making use of refs that keep up to date values between renders.
  • Refactor 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.

v3.3.5

13 Oct 21:25
Compare
Choose a tag to compare

Change Log

🐞 Bugfix

  • Fix broken exported TypeScript types.

🛠 Misc

  • Optimized build process that produces smaller bundle sizes.

v3.3.4

27 Aug 21:22
Compare
Choose a tag to compare

Change Log

🚀 Feature

  • New property: 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.

🐞 Bugfix

  • Fix UI issue where user input would cause text to spill over and cause momentary layout shift for elements to the right of the text.

🛠 Misc

  • Performance: various internal refactorings that contribute to optimized performance and safe-guard against user error (i.e. during implementation a user does not properly memoize non-primitive props that previously would cause rerenders/refiring of effects - now some of these properties are tracked and written to refs, which are then used to avoid such issues).

v3.3.2

22 Apr 10:46
Compare
Choose a tag to compare

Change Log

🐞 Bugfix

  • FIX: in method 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).

v3.3.1

18 Apr 01:56
Compare
Choose a tag to compare

Change Log

🛠 Misc

  • Performance: memoize useImperativeHandle hook in Select.tsx component - add dependency list passed as the third param to re-create the handle when one of them updates (prior, to update, just was being recreated each render).

v3.3.0

10 Apr 05:37
Compare
Choose a tag to compare

Change Log

🚀 Feature

  • New property (Theme object) : Add new key placeholder to theme object that has an animation key with a fade-in default
  • *** Related to bullet point above - only apply that animation on renders after the first render/component mount

🐞 Bugfix

  • Fix issue with special scenario: when prop openMenuOnClick = false and the device is touch-capable, the touch event triggered by the caret icon does not open the menu

🛠 Misc

  • Performance: memoize Value.tsx component (helps especially during initial component mount as this cuts out 2 extraneous rerenders for this component

v3.2.2

06 Apr 22:40
Compare
Choose a tag to compare

Change Log

🛠 Misc

  • Performance/functionality: Moved multiple callback function props from being referenced directly in the useEffect in which they were executed and to their own useEffect in which their values would be written to a ref object. This potentially boosts both performance and unintentional side-effects in scenarios where the props are not properly memoized or where they update frequently. Impacted props: onMenuOpen, onMenuClose, onOptionChange, and onSearchChange.

v3.2.1

02 Apr 00:20
Compare
Choose a tag to compare

Change Log

🛠 Misc

  • Make use of styled-components's .attrs extension method to define static attributes in scenarios where it was previously done by spreading globally-defined objects repeatedly