Various fixes, smaller refactoring

This commit is contained in:
barsdeveloper
2023-02-04 00:15:58 +01:00
parent 8de12775a7
commit c501e2be3a
19 changed files with 175 additions and 181 deletions

View File

@@ -2,15 +2,13 @@ import IInput from "../IInput"
export default class Unfocus extends IInput {
/** @type {(e: MouseEvent) => void} */
#clickHandler
/** @param {MouseEvent} e */
#clickHandler = e => this.clickedSomewhere(/** @type {HTMLElement} */(e.target))
constructor(target, blueprint, options = {}) {
options.listenOnFocus = true
super(target, blueprint, options)
let self = this
this.#clickHandler = e => self.clickedSomewhere(/** @type {HTMLElement} */(e.target))
if (this.blueprint.focus) {
document.addEventListener("click", this.#clickHandler)
}