mirror of
https://github.com/mattermost/focalboard.git
synced 2025-02-04 19:15:49 +02:00
[GH-1946] Fix losing focus for the card title in the dialog (#1952)
This commit is contained in:
parent
42eb5ad6be
commit
e518c391aa
@ -74,28 +74,16 @@ const MarkdownEditorInput = (props: Props): ReactElement => {
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
setTimeout(() => ref.current?.focus(), 200)
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
let isMounted = true
|
||||
if (isEditing && isMounted) {
|
||||
setEditorState(EditorState.moveSelectionToEnd(editorState))
|
||||
}
|
||||
|
||||
return () => {
|
||||
isMounted = false
|
||||
if (isEditing) {
|
||||
if (initialText === '') {
|
||||
setEditorState(EditorState.createEmpty())
|
||||
} else {
|
||||
setEditorState(EditorState.moveSelectionToEnd(editorState))
|
||||
}
|
||||
setTimeout(() => ref.current?.focus(), 200)
|
||||
}
|
||||
}, [isEditing])
|
||||
|
||||
useEffect(() => {
|
||||
if (initialText === '') {
|
||||
setTimeout(() => {
|
||||
setEditorState(EditorState.createEmpty())
|
||||
}, 200)
|
||||
}
|
||||
}, [initialText])
|
||||
|
||||
const customKeyBindingFn = useCallback((e: React.KeyboardEvent) => {
|
||||
if (isMentionPopoverOpen || isEmojiPopoverOpen) {
|
||||
return undefined
|
||||
|
Loading…
x
Reference in New Issue
Block a user