Fix text story creation input
This commit is contained in:
parent
97b7f3dbc1
commit
50c48315e3
1 changed files with 31 additions and 31 deletions
|
@ -3,7 +3,6 @@
|
|||
|
||||
import type { KeyboardEvent, ReactNode } from 'react';
|
||||
import type { Options, VirtualElement } from '@popperjs/core';
|
||||
import FocusTrap from 'focus-trap-react';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { usePopper } from 'react-popper';
|
||||
|
@ -174,6 +173,13 @@ export function ContextMenu<T>({
|
|||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
}
|
||||
|
||||
if (ev.key === 'Escape') {
|
||||
setIsMenuShowing(false);
|
||||
closeCurrentOpenContextMenu = undefined;
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
}
|
||||
};
|
||||
|
||||
const handleClick = (ev: React.MouseEvent) => {
|
||||
|
@ -282,11 +288,6 @@ export function ContextMenu<T>({
|
|||
}
|
||||
|
||||
return (
|
||||
<FocusTrap
|
||||
focusTrapOptions={{
|
||||
allowOutsideClick: true,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className={classNames(
|
||||
getClassName('__container'),
|
||||
|
@ -313,6 +314,5 @@ export function ContextMenu<T>({
|
|||
</div>
|
||||
)}
|
||||
</div>
|
||||
</FocusTrap>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue