-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inaccurate tabs, add page index change callback (#3)
- Loading branch information
1 parent
a33123a
commit b374cba
Showing
31 changed files
with
717 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
"devDependencies": { | ||
"@ianvs/prettier-plugin-sort-imports": "^4.2.1", | ||
"prettier": "^3.2.5", | ||
"turbo": "^1.13.3" | ||
"turbo": "^2.0.7" | ||
}, | ||
"workspaces": [ | ||
"react-aria-carousel", | ||
|
@@ -24,5 +24,6 @@ | |
"@pandadev/css", | ||
"example", | ||
"react-aria-carousel" | ||
] | ||
], | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## Unreleased | ||
|
||
- `Carousel`, `CarouselButton`, `CarouselScroller`, `CarouselItem`, `CarouselTabs`, `CarouselTab`, `CarouselAutoplayControl` now forward the refs of their outer elements. | ||
- `useCarousel` and `Carousel` now support a new prop `onActivePageIndexChange`. This prop accepts a function that's called with the new `activePageIndex` when it's changed. Fixes #1. | ||
|
||
```jsx | ||
<Carousel | ||
onActivePageIndexChange={(args) => { | ||
setActivePageIndex(args.index); | ||
}} | ||
/> | ||
``` | ||
|
||
- Fixed a bug where having a number of items not divisible by `itemsPerPage` would not update the `activePageIndex` to the last page as expected. (e.g., if there are 8 items and the `itemsPerPage` option is set to `3`, the tabs would never reflect scrolling to the last page.) Fixes #2. | ||
- Fixed a bug where mouse dragging was jittery and buggy between the first and last items when `mouseDragging` and `loop="infinite"` were set. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,12 @@ | ||
import "@testing-library/jest-dom/vitest"; | ||
|
||
import { vi } from "vitest"; | ||
|
||
const IntersectionObserverMock = vi.fn(() => ({ | ||
disconnect: vi.fn(), | ||
observe: vi.fn(), | ||
takeRecords: vi.fn(), | ||
unobserve: vi.fn(), | ||
})); | ||
|
||
vi.stubGlobal("IntersectionObserver", IntersectionObserverMock); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.