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-controls
andaria-owns
attributes.
🐞 Bugfix
onKeyDown
property was recieving incorrect first parameter ofevent.type
instead ofevent
.
v.4.0.1
Change Log
🛠 Misc
- Remove extraneous dep list from
Effect
in custom hookuseCallbackRef
; remove extraneoususeMemo
wrapper forisMenuTopPosition
calculation in custom hookuseMenuPositioner
.
v4.0.0
Change Log
💥 Breaking Changes
- Removal of property
empty
exposed on forwardedref
toSelect
component. - Removal of key
placeholder
from 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.substr
withString.startsWith
(in customuseMenuOptions
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'scontent
property. This replaces the inefficent logic consisting of a dummy node with aref
to measure the width based on input and referencing input in anuseEffect
and updating the actual width from theref
's calculated width. Also, removed thememo
wrapper from theAutosizeInput
component.
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 eachOption
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 - makingmemo
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 memoizedOption
component is potentially beneficial -onHover
events 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.tsx
component - change check frome.currentTarget.tagName
toe.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
useImperativeHandle
hook inSelect.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
Change Log
🚀 Feature
- New property (Theme object) : Add new key
placeholder
to theme object that has ananimation
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
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 ownuseEffect
in which their values would be written to aref
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
, andonSearchChange
.
v3.2.1
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