Skip to content

Commit

Permalink
INP next arrow interaction fix
Browse files Browse the repository at this point in the history
  • Loading branch information
liatv committed Feb 28, 2024
1 parent 5f62dc7 commit 3a93569
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ export function ArrowButton({
navigationArrowPortalId,
}) {
const isNext = (directionIsLeft && isRTL) || (!directionIsLeft && !isRTL);

const nextAction = () => next({ direction: directionIsLeft ? -1 : 1 });
const buttonProps = {
className: arrowsBaseClasses.join(' '),
onClick: () => setTimeout(next({ direction: directionIsLeft ? -1 : 1 }), 0),
onClick: () => setTimeout(nextAction, 0),
['aria-label']: `${isNext ? 'Next' : 'Previous'} Item`,
tabIndex: tabIndex(isNext ? 'slideshowNext' : 'slideshowPrev'),
key: !isNext ? 'nav-arrow-back' : 'nav-arrow-next',
Expand Down Expand Up @@ -229,11 +229,12 @@ export function ArrowButtonWithCursorController(props) {
renderArrowSvg,
} = props;
const isTheOnlyArrow = hideLeftArrow || hideRightArrow;
const nextAction = () => next({ direction: directionIsLeft ? -1 : 1 });
return (
<ArrowFollower
id={props.id}
mouseCursorContainerMaxWidth={mouseCursorContainerMaxWidth}
onNavigate={() => next({ direction: directionIsLeft ? -1 : 1 })}
onNavigate={nextAction}
direction={directionIsLeft ? 'left' : 'right'}
isTheOnlyArrow={isTheOnlyArrow}
>
Expand Down

0 comments on commit 3a93569

Please sign in to comment.