Merge pull request #19 from ueberdosis/fix/autofocus
Fix the broken autoFocus option
This commit is contained in:
@@ -4,10 +4,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')
|
||||
})
|
||||
cy.get('.ProseMirror p:first').should('have.class', 'has-focus')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="editor">
|
||||
<div>
|
||||
<editor-content :editor="editor" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -122,7 +122,7 @@ export class Editor extends EventEmitter {
|
||||
this.registerCommands(coreCommands)
|
||||
this.injectCSS()
|
||||
|
||||
this.proxy.focus(this.options.autoFocus)
|
||||
window.setTimeout(() => this.proxy.focus(this.options.autoFocus), 0)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user