mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-28 03:24:43 +08:00
Input cleanup
This commit is contained in:
@@ -5,7 +5,12 @@ import ITemplate from "./ITemplate"
|
||||
/** @extends {ITemplate<InputElement>} */
|
||||
export default class InputTemplate extends ITemplate {
|
||||
|
||||
#focusHandler = () => this.element.blueprint.dispatchEditTextEvent(true)
|
||||
#focusHandler = () => {
|
||||
this.element.blueprint.dispatchEditTextEvent(true)
|
||||
if (this.element.selectOnFocus) {
|
||||
getSelection().selectAllChildren(this.element)
|
||||
}
|
||||
}
|
||||
#focusoutHandler = () => {
|
||||
this.element.blueprint.dispatchEditTextEvent(false)
|
||||
document.getSelection()?.removeAllRanges() // Deselect eventually selected text inside the input
|
||||
|
||||
Reference in New Issue
Block a user