mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 01:56:27 +08:00
fix: hotkey 'cmd+k' bug
This commit is contained in:
@@ -28,6 +28,10 @@ export const ModalProvider = ({
|
||||
const down = (e: KeyboardEvent) => {
|
||||
if (e.key === 'k' && e.metaKey) {
|
||||
const selection = window.getSelection();
|
||||
if (selection?.toString()) {
|
||||
setOpenQuickSearchModal(false);
|
||||
return;
|
||||
}
|
||||
if (selection?.isCollapsed) {
|
||||
setOpenQuickSearchModal(
|
||||
openQuickSearchModal => !openQuickSearchModal
|
||||
|
||||
Reference in New Issue
Block a user