add comment about broken autoFocus option
This commit is contained in:
@@ -5,8 +5,6 @@ context('/examples/focus', () => {
|
|||||||
|
|
||||||
it('should have class', () => {
|
it('should have class', () => {
|
||||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
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>
|
<template>
|
||||||
<div class="editor">
|
<div>
|
||||||
<editor-content :editor="editor" />
|
<editor-content :editor="editor" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -56,8 +56,8 @@
|
|||||||
# - title: Placeholder
|
# - title: Placeholder
|
||||||
# link: /examples/placeholder
|
# link: /examples/placeholder
|
||||||
# draft: true
|
# draft: true
|
||||||
# - title: Focus
|
- title: Focus
|
||||||
# link: /examples/focus
|
link: /examples/focus
|
||||||
# - title: Title
|
# - title: Title
|
||||||
# link: /examples/title
|
# link: /examples/title
|
||||||
# draft: true
|
# draft: true
|
||||||
|
|||||||
@@ -122,7 +122,14 @@ export class Editor extends EventEmitter {
|
|||||||
this.registerCommands(coreCommands)
|
this.registerCommands(coreCommands)
|
||||||
this.injectCSS()
|
this.injectCSS()
|
||||||
|
|
||||||
|
// TODO: The autoFocus option has no impact
|
||||||
|
// Doesn’t work
|
||||||
this.proxy.focus(this.options.autoFocus)
|
this.proxy.focus(this.options.autoFocus)
|
||||||
|
// Does work
|
||||||
|
// window.setTimeout(() => {
|
||||||
|
// console.log(this.options.autoFocus)
|
||||||
|
// this.proxy.focus(this.options.autoFocus)
|
||||||
|
// }, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user