Skip to content

RichText: Expose a method setFocus for focusing the input conditionally. #15

Description

@sharvilak11

Using a ref for rich-text, there needs to be a setFocus method for conditionally setting the focus in order to cover keyboard a11y.

For my use case, I am trying to focus the input conditionally only when the modal is closed.

Type of Issue

  • Bug fix
  • New feature

Expected Behavior

Current Behavior

Possible Solution

Add a new method to methods.

setFocus() {
   this.$refs.editor.commands.focus()
}

Steps to Reproduce

Context (Environment)

https://www.tiptap.dev/api/commands/focus/#focus

Detailed Description

Possible Implementation

https://www.tiptap.dev/api/commands/focus/#focus

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions