mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-19 10:51:34 +03:00
fix:commend-menu postion
This commit is contained in:
parent
32be658e96
commit
fa458f06a4
@ -129,8 +129,12 @@ export const CommandMenu = ({ editor, hooks, style }: CommandMenuProps) => {
|
|||||||
if (clientHeight - rectTop <= COMMAND_MENU_HEIGHT) {
|
if (clientHeight - rectTop <= COMMAND_MENU_HEIGHT) {
|
||||||
setCommandMenuPosition({
|
setCommandMenuPosition({
|
||||||
left: rect.left - left,
|
left: rect.left - left,
|
||||||
bottom: rectTop - top + 10,
|
top:
|
||||||
top: 'initial',
|
rectTop -
|
||||||
|
top -
|
||||||
|
COMMAND_MENU_HEIGHT +
|
||||||
|
20,
|
||||||
|
bottom: 'initial',
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setCommandMenuPosition({
|
setCommandMenuPosition({
|
||||||
@ -189,6 +193,7 @@ export const CommandMenu = ({ editor, hooks, style }: CommandMenuProps) => {
|
|||||||
},
|
},
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const sub = hooks
|
const sub = hooks
|
||||||
.get(HookType.ON_ROOT_NODE_KEYUP)
|
.get(HookType.ON_ROOT_NODE_KEYUP)
|
||||||
|
Loading…
Reference in New Issue
Block a user