Text Formatter: Fix focus loss when clicking inactive buttons (#2397)

This commit is contained in:
Alexander Zinchuk 2023-01-28 02:16:34 +01:00
parent b0e3832a75
commit 01c5920b9a

View File

@ -12,6 +12,7 @@ import { ensureProtocol } from '../../../util/ensureProtocol';
import captureEscKeyListener from '../../../util/captureEscKeyListener';
import getKeyFromEvent from '../../../util/getKeyFromEvent';
import { INPUT_CUSTOM_EMOJI_SELECTOR } from './helpers/customEmoji';
import stopEvent from '../../../util/stopEvent';
import useShowTransition from '../../../hooks/useShowTransition';
import useVirtualBackdrop from '../../../hooks/useVirtualBackdrop';
@ -415,6 +416,8 @@ const TextFormatter: FC<OwnProps> = ({
className={className}
style={style}
onKeyDown={handleContainerKeyDown}
// Prevents focus loss when clicking on the toolbar
onMouseDown={stopEvent}
>
<div className="TextFormatter-buttons">
<Button