0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Koenig - Fixed autofocus of markdown card when entering edit mode

refs https://github.com/TryGhost/Ghost/issues/9505
- add `autofocus` property to markdown editor component
- remove autofocus routine that was in place for old textarea based editor
This commit is contained in:
Kevin Ansfield 2018-04-25 16:15:56 +01:00
parent 13c402cfe8
commit 483ab830b0
2 changed files with 2 additions and 7 deletions

View file

@ -59,9 +59,7 @@ export default Component.extend({
actions: {
enterEditMode() {
// this action is called before the component is rendered so we
// need to wait to ensure that the textarea element is present
run.scheduleOnce('afterRender', this, this._focusTextarea);
},
leaveEditMode() {
@ -121,10 +119,6 @@ export default Component.extend({
}
},
_focusTextarea() {
this.element.querySelector('textarea').focus();
},
_applyToolbarStyles() {
let toolbar = this.element.querySelector('.editor-toolbar');

View file

@ -21,6 +21,7 @@
{{#gh-markdown-editor
markdown=(readonly payload.markdown)
onChange=(action "updateMarkdown")
autofocus=true
enableSideBySide=false
enablePreview=false
enableHemingway=false