mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 01:09:54 +08:00
chore(editor): keep root slash menu open when pressing left arrow left (#10730)
Close [BS-2643](https://linear.app/affine-design/issue/BS-2643/slash-menu-左键不关闭根菜单)
This commit is contained in:
@@ -216,7 +216,14 @@ export class SlashMenu extends WithDisposable(LitElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (key === 'ArrowRight' || key === 'ArrowLeft' || key === 'Escape') {
|
||||
if (key === 'Escape') {
|
||||
this.abortController.abort();
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return;
|
||||
}
|
||||
|
||||
if (key === 'ArrowRight' || key === 'ArrowLeft') {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -542,7 +549,14 @@ export class InnerSlashMenu extends WithDisposable(LitElement) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
if ((key === 'ArrowLeft' || key === 'Escape') && notControlShift) {
|
||||
if (key === 'ArrowLeft' && notControlShift) {
|
||||
if (this.depth != 0) this.abortController.abort();
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
if (key === 'Escape' && notControlShift) {
|
||||
this.abortController.abort();
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user