Releases: based-ghost/react-functional-select
Releases · based-ghost/react-functional-select
v4.1.0
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'saria-controlsandaria-ownsattributes. 
🐞 Bugfix
onKeyDownproperty was recieving incorrect first parameter ofevent.typeinstead ofevent.
v.4.0.1
Change Log
🛠 Misc
- Remove extraneous dep list from 
Effectin custom hookuseCallbackRef; remove extraneoususeMemowrapper forisMenuTopPositioncalculation in custom hookuseMenuPositioner. 
v4.0.0
Change Log
💥 Breaking Changes
- Removal of property 
emptyexposed on forwardedreftoSelectcomponent. - Removal of key 
placeholderfrom theme object. - No longer exporting type 
SelectProps- equivalent can be achieved by creating new type usingReact.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.substrwithString.startsWith(in customuseMenuOptionshook). 
🛠 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 
AutosizeInputcomponent to handle resizing via CSS +data-valueattribute mapped to a psuedo element'scontentproperty. This replaces the inefficent logic consisting of a dummy node with arefto measure the width based on input and referencing input in anuseEffectand updating the actual width from theref's calculated width. Also, removed thememowrapper from theAutosizeInputcomponent. 
v3.3.5
Change Log
🐞 Bugfix
- Fix broken exported TypeScript types.
 
🛠 Misc
- Optimized build process that produces smaller bundle sizes.
 
v3.3.4
Change Log
🚀 Feature
- New property: 
memoOptions|bool| default:false- Whether to memoize eachOptioncomponent. 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 - makingmemofor 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 memoizedOptioncomponent is potentially beneficial -onHoverevents forOption. 
🐞 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
Change Log
🐞 Bugfix
- FIX: in method 
handleOnControlMouseDown()ofSelect.tsxcomponent - change check frome.currentTarget.tagNametoe.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
Change Log
🛠 Misc
- Performance: memoize 
useImperativeHandlehook inSelect.tsxcomponent - 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
Change Log
🚀 Feature
- New property (Theme object) :  Add new key 
placeholderto theme object that has ananimationkey 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.tsxcomponent (helps especially during initial component mount as this cuts out 2 extraneous rerenders for this component 
v3.2.2
Change Log
🛠 Misc
- Performance/functionality: Moved multiple callback function props from being referenced directly in the 
useEffectin which they were executed and to their ownuseEffectin which their values would be written to arefobject. 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, andonSearchChange. 
v3.2.1
Change Log
🛠 Misc
- Make use of 
styled-components's.attrsextension method to define static attributes in scenarios where it was previously done by spreading globally-defined objects repeatedly