Feature #43259 » 0001-wiki-toolbar-keep-textarea-focus.patch
| app/javascript/controllers/wiki_toolbar_controller.js | ||
|---|---|---|
|
if (!this.field) return
|
||
|
if (!this.editorTarget.contains(this.field)) {
|
||
|
// Moving the element reconnects the controller
|
||
|
// Moving the element removes the focus and reconnects the controller
|
||
|
this.focusField = document.activeElement === this.field
|
||
|
this.field.before(this.element)
|
||
|
this.editorTarget.prepend(this.field)
|
||
|
}
|
||
| ... | ... | |
|
.catch((error) => console.error(`Wiki toolbar syntax not found for ${this.formatValue}`, error))
|
||
|
this.addShortcutsToTitles()
|
||
|
this.element.hidden = false
|
||
|
if (this.focusField) this.field.focus()
|
||
|
this.focusField = false
|
||
|
}
|
||
|
disconnect() {
|
||