MM-63411 Don't focus thread textbox automatically when it has a draft (#31250)

* MM-63411 Don't focus thread textbox automatically when it has a draft

* Add E2E test

* Add test files forgotten in previous commit

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Harrison Healey
2025-06-04 16:08:33 -04:00
коммит произвёл GitHub
родитель a19eb5b9ef
Коммит 6517fa2fd1
7 изменённых файлов: 175 добавлений и 2 удалений

Просмотреть файл

@@ -523,7 +523,7 @@ const AdvancedTextEditor = ({
// Update the caret position in the input box when changed by a side effect
useEffect(() => {
const textbox: HTMLInputElement | HTMLTextAreaElement | undefined = textboxRef.current?.getInputBox();
if (textbox && textbox.selectionStart !== caretPosition) {
if (textbox && textbox === document.activeElement && textbox.selectionStart !== caretPosition) {
Utils.setCaretPosition(textbox, caretPosition);
}
}, [caretPosition]);