Event bug fixes

This commit is contained in:
n1474335 2023-01-13 16:46:41 +00:00
parent e9d7a8363c
commit d6159cc154
3 changed files with 22 additions and 9 deletions

View file

@ -805,9 +805,10 @@ class InputWaiter {
e.stopPropagation();
e.preventDefault();
// Dragleave often fires when moving between lines in the editor.
// If the target element is within the input-text element, we are still on target.
if (!this.inputTextEl.contains(e.target))
// If the from element is within the input-text element, we are still on target.
if (!this.inputTextEl.contains(e.fromElement)) {
e.target.closest("#input-text").classList.remove("dropping-file");
}
}
/**
@ -994,6 +995,9 @@ class InputWaiter {
if (changeOutput) {
this.manager.output.changeTab(inputNum, false);
}
// Set cursor focus to current tab
this.inputEditorView.focus();
}
/**
@ -1108,7 +1112,7 @@ class InputWaiter {
* @param {number} inputNum - The inputNum of the new tab
* @param {boolean} [changeTab=true] - If true, changes to the new tab once it's been added
*/
addTab(inputNum, changeTab = true) {
addTab(inputNum, changeTab=true) {
const tabsWrapper = document.getElementById("input-tabs"),
numTabs = tabsWrapper.children.length;