Skip to content

Commit ffd038d

Browse files
Jing-yilinclaude
andcommitted
A click anywhere closes a presented board, which no longer takes the focus
Clicking the board put the focus in its frame, where Space and Esc are not heard, so it could not be closed from the keyboard. The frame now takes no pointer, and any click closes it, the board included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 06b5c6d commit ffd038d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎canvas/src/CanvasPresent.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function CanvasPresent({ editor }: { editor: Editor | null }) {
6060

6161
/**
6262
* Something shown alone over the whole window, the window dimmed round it: a board or picture
63-
* from the canvas, or a picture in the chat. Space, Esc or a click beside it comes back to where
63+
* from the canvas, or a picture in the chat. Space, Esc or a click anywhere comes back to where
6464
* it was. Inside the window rather than the browser's full screen, which on a Mac moves the window
6565
* to a display of its own and back, slowly.
6666
*
@@ -92,7 +92,7 @@ export function Present({
9292
return createPortal(
9393
<div
9494
className="sp-present"
95-
onClick={(e) => e.target === e.currentTarget && close()}
95+
onClick={close}
9696
>
9797
{children}
9898
</div>,

‎canvas/src/index.css‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,6 +1994,8 @@ a.sp-menu-row {
19941994
left: 50%;
19951995
translate: -50% -50%;
19961996
border: 0;
1997+
/* A click would focus the board's own document, which the keys that close this never leave. */
1998+
pointer-events: none;
19971999
/* The board's own scheme, as on the canvas (CanvasFileShapeUtil.tsx). */
19982000
color-scheme: light;
19992001
}

0 commit comments

Comments
 (0)