Releases: melt-ui/next-gen
[email protected]
Patch Changes
-
Fix
onNavigate
callback behavior in Combobox and Select components (be3bf49
)Previously, the
onNavigate
callback would only handle custom navigation and never fall back to default behavior when returningnull
. Now correctly implements the documented behavior:- When
onNavigate
returns a value: uses that value for navigation - When
onNavigate
returnsnull
: falls back to default DOM-based navigation
This allows for more flexible navigation handling, such as selective override of navigation behavior in specific scenarios while maintaining default behavior in others.
- When
[email protected]
Patch Changes
- fix(toaster): effect used in constructor (#173)
[email protected]
Minor Changes
-
Add
onNavigate
prop to Combobox and Select components for virtualization support (a11b306
)- Combobox: Added optional
onNavigate
callback to enable custom navigation logic for virtualized lists - Select: Added optional
onNavigate
callback to enable custom navigation logic for virtualized lists
The
onNavigate
prop allows virtualization libraries to handle arrow key navigation properly by providing the full dataset instead of relying on DOM-queried options. This fixes wrap-around behavior where navigation would only cycle through currently rendered items instead of the complete list.Usage:
const combobox = new Combobox({ onNavigate: (current, direction) => { // Handle navigation with full dataset const currentIndex = fullDataset.findIndex((item) => item === current); if (direction === "next") { return fullDataset[(currentIndex + 1) % fullDataset.length]; } else { return fullDataset[(currentIndex - 1 + fullDataset.length) % fullDataset.length]; } }, });
This is a non-breaking change - when
onNavigate
is not provided, both components fall back to their existing DOM-based navigation behavior. - Combobox: Added optional
[email protected]
Minor Changes
- toaster: add
pauseAll()
andresumeAll()
functions (#145)
[email protected]
Patch Changes
- combobox: fix focus (
a7932e6
)
[email protected]
[email protected]
[email protected]
Minor Changes
- feat: add spatial menu (#155)
[email protected]
Patch Changes
- select & combobox: remove generic restriction (
4549eb9
)