mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-24 18:02:47 +08:00
fix(editor): mid button drag in presentation mode (#12309)
Fixes https://linear.app/affine-design/issue/BS-3448 Before this PR, presentation mode would force quit if user either: 1. Press space 2. Drag with mouse middle button Unfixed behavior: https://github.com/user-attachments/assets/8ff4e13a-69a8-4de6-8994-bf36e6e3eb49 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved presentation mode to preserve your current panned view when exiting pan mode or toggling fullscreen, preventing unwanted viewport resets. - Spacebar actions are now correctly disabled when using the frame navigator tool, avoiding accidental tool switches. - **New Features** - Enhanced presentation controls for smoother transitions and better handling of user navigation states. - Added a one-time toast notification for presentations without frames, shown only once per session for better user guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -467,6 +467,9 @@ export class EdgelessPageKeyboardManager extends PageKeyboardManager {
|
||||
const selection = gfx.selection;
|
||||
|
||||
if (event.code === 'Space' && !event.repeat) {
|
||||
const currentToolName =
|
||||
this.rootComponent.gfx.tool.currentToolName$.peek();
|
||||
if (currentToolName === 'frameNavigator') return false;
|
||||
this._space(event);
|
||||
} else if (
|
||||
!selection.editing &&
|
||||
@@ -504,8 +507,12 @@ export class EdgelessPageKeyboardManager extends PageKeyboardManager {
|
||||
ctx => {
|
||||
const event = ctx.get('keyboardState').raw;
|
||||
if (event.code === 'Space' && !event.repeat) {
|
||||
const currentToolName =
|
||||
this.rootComponent.gfx.tool.currentToolName$.peek();
|
||||
if (currentToolName === 'frameNavigator') return false;
|
||||
this._space(event);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
{ global: true }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user