mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-22 14:54:43 +08:00
Blueprint focusable
This commit is contained in:
23
js/input/Context.js
Normal file
23
js/input/Context.js
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class Context {
|
||||
|
||||
constructor(target, blueprint, options) {
|
||||
/** @type {HTMLElement} */
|
||||
this.target = target
|
||||
/** @type {import("../Blueprint").default}" */
|
||||
this.blueprint = blueprint
|
||||
this.options = options
|
||||
if (options?.wantsFocusCallback ?? false) {
|
||||
let self = this
|
||||
this.blueprint.addEventListener("blueprintfocus", _ => self.blueprintFocused())
|
||||
this.blueprint.addEventListener("blueprintunfocus", _ => self.blueprintUnfocused())
|
||||
}
|
||||
}
|
||||
|
||||
blueprintFocused() {
|
||||
console.log("focused")
|
||||
}
|
||||
|
||||
blueprintUnfocused() {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user