diff --git a/CHANGELOG.md b/CHANGELOG.md index ae356c18..2c14bc68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - bug fixes - textarea: escape key not restoring previous value + - scripting: `setFocus(id)` not affecting textarea widgets ## 1.25.1 diff --git a/src/client/widgets/basics/textarea.js b/src/client/widgets/basics/textarea.js index a9bdb350..77f49c8d 100644 --- a/src/client/widgets/basics/textarea.js +++ b/src/client/widgets/basics/textarea.js @@ -43,7 +43,7 @@ class TextArea extends Widget { if (this.getProp('interaction')) { this.input.setAttribute('tabindex', 0) - this.on('focus', this.focus.bind(this), {element: this.input}) + this.on('focus', this.onFocus.bind(this), {element: this.input}) this.on('blur', (e)=>{ this.blur(true) }, {element: this.input}) @@ -65,13 +65,19 @@ class TextArea extends Widget { } - focus() { + onFocus() { if (this.focused) return this.focused = true } + focus() { + + this.input.focus() + + } + blur(change=true) { if (!this.focused) return