Bug 1756488 - trigger update of react state for bug filer after log content got copied into it with button

The button to transfer selected text from the log viewer into the bug filer in a
different tab got added in bug bug 1745936 but didn't trigger React's `onChange`
event.
This commit is contained in:
Sebastian Hengst 2022-02-17 17:24:55 +01:00
Родитель c8314072e4
Коммит deccc196fb
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -225,6 +225,10 @@ class App extends React.PureComponent {
descriptionField.value.substring(endPos, descriptionField.value.length);
descriptionField.selectionStart = startPos + selectedLogText.length;
descriptionField.selectionEnd = startPos + selectedLogText.length;
const event = document.createEvent('HTMLEvents');
event.initEvent('change', true, true);
descriptionField.dispatchEvent(event);
};
collapseJobDetails = () => {