When setting mode from readonly to design, tinymce steals focus
See original GitHub issueDo you want to request a feature or report a bug?
Bug
What is the current behavior?
- When tinymce is in
readonly
mode - If it is set to
design
mode - It automatically sets focus to the text field
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via fiddle.tinymce.com or similar.
Here is a demo: http://fiddle.tinymce.com/f2gaab/1
- Tinymce is set to readonly on load
- Click “toggle enabled” button to set tinymce to “design” mode
What is the expected behavior?
Tinymce should not take focus when set to design mode.
I have a form that has many fields disabled, one of which is a tinymce text area. When enabling the form, all fields become enabled, but tinymce is not the first field in the form, and it is unexpected that it would take focus.
Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE?
Versions: I have tested this in edge and 4.8.3 in the fiddle. Browser: Chrome OS: Mac OSX
I don’t know if this worked in previous versions.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:6 (1 by maintainers)
Waiting for that config! Very annoying behaviour.
setMode(mode)
method (v4) triggers a focus event after changing from readonly to design mode. Seems V5 doesn’t have this unexpected behavior becosesetMode
method was deprecated and useeditor.mode.set(mode)
instead.Workaround v4
Instead use
setMode()
you can set thecontenteditable
property manually