From eabcecb550e90b37be7dbb697b0f58ea4604cf91 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Fri, 2 Oct 2020 15:45:45 +0200 Subject: [PATCH] add comment about broken autoFocus option --- docs/src/demos/Examples/Focus/index.spec.js | 2 -- docs/src/demos/Examples/Focus/index.vue | 2 +- docs/src/links.yaml | 4 ++-- packages/core/src/Editor.ts | 7 +++++++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/src/demos/Examples/Focus/index.spec.js b/docs/src/demos/Examples/Focus/index.spec.js index f36629de..1c7271a6 100644 --- a/docs/src/demos/Examples/Focus/index.spec.js +++ b/docs/src/demos/Examples/Focus/index.spec.js @@ -5,8 +5,6 @@ context('/examples/focus', () => { it('should have class', () => { cy.get('.ProseMirror').then(([{ editor }]) => { - editor.focus('start') - cy.get('.ProseMirror p:first').should('have.class', 'has-focus') }) }) diff --git a/docs/src/demos/Examples/Focus/index.vue b/docs/src/demos/Examples/Focus/index.vue index 063f9212..033c14da 100644 --- a/docs/src/demos/Examples/Focus/index.vue +++ b/docs/src/demos/Examples/Focus/index.vue @@ -1,5 +1,5 @@ diff --git a/docs/src/links.yaml b/docs/src/links.yaml index 94e80146..fb415661 100644 --- a/docs/src/links.yaml +++ b/docs/src/links.yaml @@ -56,8 +56,8 @@ # - title: Placeholder # link: /examples/placeholder # draft: true - # - title: Focus - # link: /examples/focus + - title: Focus + link: /examples/focus # - title: Title # link: /examples/title # draft: true diff --git a/packages/core/src/Editor.ts b/packages/core/src/Editor.ts index 2be9f517..87e50e39 100644 --- a/packages/core/src/Editor.ts +++ b/packages/core/src/Editor.ts @@ -122,7 +122,14 @@ export class Editor extends EventEmitter { this.registerCommands(coreCommands) this.injectCSS() + // TODO: The autoFocus option has no impact + // Doesn’t work this.proxy.focus(this.options.autoFocus) + // Does work + // window.setTimeout(() => { + // console.log(this.options.autoFocus) + // this.proxy.focus(this.options.autoFocus) + // }, 100) } /**