We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93dae66 commit 33b606eCopy full SHA for 33b606e
src/Preview/index.tsx
@@ -313,15 +313,13 @@ const Preview: React.FC<PreviewProps> = props => {
313
};
314
315
const onActive = (offset: number) => {
316
- const position = current + offset;
+ const nextCurrent = current + offset;
317
318
- if (!Number.isInteger(position) || position < 0 || position > count - 1) {
319
- return;
+ if (nextCurrent >= 0 && nextCurrent <= count - 1) {
+ setEnableTransition(false);
320
+ resetTransform(offset < 0 ? 'prev' : 'next');
321
+ onChange?.(nextCurrent, current);
322
}
-
- setEnableTransition(false);
323
- resetTransform(offset < 0 ? 'prev' : 'next');
324
- onChange?.(position, current);
325
326
327
// >>>>> Effect: Keyboard
0 commit comments