Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if ( event.nativeEvent.defaultPrevented ) {
return;
}
const isAtEdge = isVertical ? isVerticalEdge : isHorizontalEdge;
const isReverse = isUp || isLeft || isHome;
const isCaretAtEdgeOfField = isAtEdge( target, isReverse );
if ( ! isCaretAtEdgeOfField ) {
return;
}
event.stopPropagation();
event.preventDefault();
const isPrimary = isKeyboardModifierEvent.primary( event );
const nextCellLocation = getNextCellLocation( tableState, selectedCell, { isPrimary, isUp, isDown, isLeft, isRight, isHome, isEnd } );
if ( ! nextCellLocation ) {
return;
}
const contentEditableElement = getCellContentEditableElement( tableRef.current, nextCellLocation );
if ( ! contentEditableElement ) {
return;
}
placeCaretAtHorizontalEdge( contentEditableElement, isReverse );
};