Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

how to set focus on editor component #30

Open
dantrevino opened this issue Jun 3, 2019 · 1 comment
Open

how to set focus on editor component #30

dantrevino opened this issue Jun 3, 2019 · 1 comment

Comments

@dantrevino
Copy link

Version

@toast-ui/vue-editor": "^1.0.4

Test Environment

Chromium Version 74.0.3729.169 (Official Build) Built on Ubuntu , running on Ubuntu 19.04 (64-bit)
Google Chrome Version 74.0.3729.157 (Official Build) (64-bit)

Current Behavior

Set focus does not work. None of the below options work, including the TUI Editor API

mounted () {
    this.$refs.editor.focus()
    this.$nextTick(function() {
      this.$refs.editor.focus()
    })
    this.$refs.editor.invoke('focus')
}

Expected Behavior

Upon render cursor should be set to the contenteditable div

<div contenteditable="true" class="tui-editor-contents tui-editor-contents-placeholder" data-placeholder="Start writing here..."><div>

Same as issue nhn/tui.editor#314 which was closed with no resolution.
Sample image from the github issue above:

@sohee-lee7
Copy link
Contributor

@dantrevino Sorry for late reply. I try to reproduce this issue but focus works well in mounted function. Is set ref as editor in your editor?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants