tiptap
tiptap copied to clipboard
[Bug]: React `useEditor` option `autofocus` doesn't work since 2.2.0
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?
- [X] Yes, I’ve updated my dependencies to use the latest version of all packages.
Are you sponsoring us?
- [ ] Yes, I’m a sponsor. 💖
Im doing this for now - on EditorProvider
editorProps={{
attributes: {
...(props.autoFocus ? { autofocus: "true" } : {}),
},
}}
Seems to have been fixed on 2.5.4 (possibly before)
Can confirm, has been fixed in React