;
/** Function that can be called to disable dragging in the pager */
onNext: () => void;
/** True if this image is currently shown in pager, otherwise false */
@@ -40,6 +41,7 @@ const ImageStage = ({
images,
inline,
onClose,
+ onKeyDown,
onNext,
onPrev,
renderImageOverlay,
@@ -57,9 +59,11 @@ const ImageStage = ({
const [{ height: containerHeight, width: containerWidth }, containerRef] = useRefSize();
return (
+ // oxlint-disable-next-line jsx-a11y/no-static-element-interactions -- an inline carousel handles the keys that bubble up from the controls inside it
;
/** React-Spring useTransition config for page open/close animation */
pageTransitionConfig: any;
/** Inline styles are applied to the root lightbox component */
@@ -27,6 +28,7 @@ const PageContainer = ({
children,
className,
isOpen,
+ onKeyDown,
pageTransitionConfig,
style,
}: IPageContainerProps) => {
@@ -55,7 +57,10 @@ const PageContainer = ({
aria-modal="true"
className={`lightbox-container${className ? ` ${className}` : ''}`}
data-testid="lightbox-container"
- onKeyDown={wrapTab}
+ onKeyDown={(event) => {
+ wrapTab(event);
+ onKeyDown(event);
+ }}
ref={dialogRef}
// oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- resetting the browser border and padding of a