Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: React useEditor option autofocus doesn't work since 2.2.0 #5005

Closed
1 of 2 tasks
jiegillet opened this issue Mar 22, 2024 · 3 comments
Closed
1 of 2 tasks

[Bug]: React useEditor option autofocus doesn't work since 2.2.0 #5005

jiegillet opened this issue Mar 22, 2024 · 3 comments
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@jiegillet
Copy link
Contributor

jiegillet commented Mar 22, 2024

Which packages did you experience the bug in?

react

What Tiptap version are you using?

2.2.4

What’s the bug you are facing?

Setting the option autofocus: true (or other values like start or end) doesn't have any effect since 2.2.0.

What browser are you using?

Chrome

Code example

https://codesandbox.io/p/sandbox/cranky-boyd-x7c33h?file=%2Fsrc%2FApp.js

What did you expect to happen?

When loading the editor, it should be focused when autofocus is set.

Anything to add? (optional)

The code example I provided only has the autofocus: true line added from the default template.
With the tiptap dependencies changed to to 2.1.16, the autofocus works, but no version after that.

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@jiegillet jiegillet added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Mar 22, 2024
@github-project-automation github-project-automation bot moved this to Triage open in Tiptap Mar 22, 2024
@hjoelh
Copy link
Contributor

hjoelh commented Apr 30, 2024

Im doing this for now - on EditorProvider

    editorProps={{
      attributes: {
        ...(props.autoFocus ? { autofocus: "true" } : {}),
      },
    }}

@jiegillet
Copy link
Contributor Author

Seems to have been fixed on 2.5.4 (possibly before)

@nperez0111
Copy link

Can confirm, has been fixed in React

@github-project-automation github-project-automation bot moved this from Triage open to Done in Tiptap Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
No open projects
Archived in project
Development

No branches or pull requests

3 participants