fix keydown event listener not handling arrow press

This commit is contained in:
KDSBrowne 2024-05-16 17:20:20 +00:00
parent d02aeaed9e
commit efea396020

View File

@ -632,7 +632,7 @@ const Whiteboard = React.memo(function Whiteboard(props) {
const handleArrowPress = (event) => {
const currPageNum = parseInt(curPageIdRef.current);
const shapeSelected = tlEditorRef.current.selectedShapes.length > 0;
const shapeSelected = tlEditorRef.current.getSelectedShapes()?.length > 0;
const changeSlide = (direction) => {
if (!currentPresentationPage) return;
let newSlideNum = currPageNum + direction;
@ -671,7 +671,7 @@ const Whiteboard = React.memo(function Whiteboard(props) {
if (
(undoCondition || redoCondition) &&
(isPresenter || hasWBAccessRef.current)
(isPresenterRef.current || hasWBAccessRef.current)
) {
event.preventDefault();
event.stopPropagation();
@ -687,7 +687,7 @@ const Whiteboard = React.memo(function Whiteboard(props) {
if (
(event.keyCode === KEY_CODES.ARROW_RIGHT ||
event.keyCode === KEY_CODES.ARROW_LEFT) &&
isPresenter
isPresenterRef.current
) {
handleArrowPress(event);
}