change event trigger to mousedown

This will fix an issue where the box is accidentally closed when attempting to quickly select text in the textarea.
This commit is contained in:
AssassinJN 2023-06-27 09:29:58 -04:00 committed by GitHub
parent d6b996b28e
commit 4b3de4c656
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -400,7 +400,7 @@ function loadCustomModifiers() {
}
function showModifierContainer() {
document.addEventListener("click", checkIfClickedOutsideDropdownElem)
document.addEventListener("mousedown", checkIfClickedOutsideDropdownElem)
modifierDropdown.dataset.active = true
editorModifiersContainer.classList.add("active")
@ -565,7 +565,7 @@ modifierSettingsCloseBtn.addEventListener("click", (e) => {
modifierSettingsDialog.close()
})
modifierSettingsDialog.addEventListener('click', function (event) {
modifierSettingsDialog.addEventListener('mousedown', function (event) {
var rect = modifierSettingsDialog.getBoundingClientRect();
var isInDialog=(rect.top <= event.clientY && event.clientY <= rect.top + rect.height
&& rect.left <= event.clientX && event.clientX <= rect.left + rect.width);