handle select all shortcut in whiteboard
This commit is contained in:
parent
3e3d18f73b
commit
5d0b1c842f
@ -550,8 +550,8 @@ export default function Whiteboard(props) {
|
||||
previousSlide(+curPageId, podId);
|
||||
};
|
||||
|
||||
const switchSlide = (event) => {
|
||||
const { which } = event;
|
||||
const handleOnKeyDown = (event) => {
|
||||
const { which, ctrlKey } = event;
|
||||
|
||||
switch (which) {
|
||||
case KEY_CODES.ARROW_LEFT:
|
||||
@ -565,6 +565,13 @@ export default function Whiteboard(props) {
|
||||
case KEY_CODES.ENTER:
|
||||
fullscreenToggleHandler();
|
||||
break;
|
||||
case KEY_CODES.A:
|
||||
if (ctrlKey) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
tldrawAPI?.selectAll();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
};
|
||||
@ -886,7 +893,7 @@ export default function Whiteboard(props) {
|
||||
if (currentTool && !isPanning) tldrawAPI?.selectTool(currentTool);
|
||||
|
||||
const editableWB = (
|
||||
<Styled.EditableWBWrapper onKeyDown={switchSlide}>
|
||||
<Styled.EditableWBWrapper onKeyDown={handleOnKeyDown}>
|
||||
<Tldraw
|
||||
key={`wb-${isRTL}-${dockPos}`}
|
||||
document={doc}
|
||||
|
@ -8,6 +8,7 @@ export const ARROW_RIGHT = 39;
|
||||
export const ARROW_LEFT = 37;
|
||||
export const PAGE_UP = 33;
|
||||
export const PAGE_DOWN = 34;
|
||||
export const A = 65;
|
||||
|
||||
export default {
|
||||
SPACE,
|
||||
@ -20,4 +21,5 @@ export default {
|
||||
ARROW_LEFT,
|
||||
PAGE_UP,
|
||||
PAGE_DOWN,
|
||||
A,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user