Skip to content

Commit 1525bd9

Browse files
Version Packages (#176)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent a11b306 commit 1525bd9

File tree

3 files changed

+30
-29
lines changed

3 files changed

+30
-29
lines changed

.changeset/tender-birds-exist.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

packages/melt/CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# melt
22

3+
## 0.40.0
4+
5+
### Minor Changes
6+
7+
- Add `onNavigate` prop to Combobox and Select components for virtualization support ([`a11b306`](https://github.com/melt-ui/next-gen/commit/a11b306de71c5e8856c4c675b761eff42a8419df))
8+
9+
- **Combobox**: Added optional `onNavigate` callback to enable custom navigation logic for virtualized lists
10+
- **Select**: Added optional `onNavigate` callback to enable custom navigation logic for virtualized lists
11+
12+
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.
13+
14+
**Usage:**
15+
16+
```typescript
17+
const combobox = new Combobox({
18+
onNavigate: (current, direction) => {
19+
// Handle navigation with full dataset
20+
const currentIndex = fullDataset.findIndex((item) => item === current);
21+
if (direction === "next") {
22+
return fullDataset[(currentIndex + 1) % fullDataset.length];
23+
} else {
24+
return fullDataset[(currentIndex - 1 + fullDataset.length) % fullDataset.length];
25+
}
26+
},
27+
});
28+
```
29+
30+
This is a non-breaking change - when `onNavigate` is not provided, both components fall back to their existing DOM-based navigation behavior.
31+
332
## 0.39.0
433

534
### Minor Changes

packages/melt/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "melt",
33
"type": "module",
4-
"version": "0.39.0",
4+
"version": "0.40.0",
55
"license": "MIT",
66
"repository": "github:melt-ui/next-gen",
77
"author": "Thomas G. Lopes",

0 commit comments

Comments
 (0)