mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
fix: error catch (#182)
This commit is contained in:
@@ -123,17 +123,13 @@ export const CommandMenu = ({ editor, hooks, style }: CommandMenuProps) => {
|
|||||||
|
|
||||||
const COMMAND_MENU_HEIGHT =
|
const COMMAND_MENU_HEIGHT =
|
||||||
window.innerHeight * 0.4;
|
window.innerHeight * 0.4;
|
||||||
const { top, left } =
|
const { top, left, bottom } =
|
||||||
editor.container.getBoundingClientRect();
|
editor.container.getBoundingClientRect();
|
||||||
if (clientHeight - rectTop <= COMMAND_MENU_HEIGHT) {
|
if (clientHeight - rectTop <= COMMAND_MENU_HEIGHT) {
|
||||||
setCommandMenuPosition({
|
setCommandMenuPosition({
|
||||||
left: rect.left - left,
|
left: rect.left - left,
|
||||||
top:
|
bottom: bottom - rect.bottom + 24,
|
||||||
rectTop -
|
top: 'initial',
|
||||||
top -
|
|
||||||
COMMAND_MENU_HEIGHT +
|
|
||||||
20,
|
|
||||||
bottom: 'initial',
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setCommandMenuPosition({
|
setCommandMenuPosition({
|
||||||
|
|||||||
Reference in New Issue
Block a user