Opened 8 years ago
Closed 8 years ago
#37243 closed defect (bug) (fixed)
TinyMCE always gets focus on load
Reported by: | afercia | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | Editor | Keywords: | needs-patch |
Focuses: | javascript | Cc: |
Description
I can reproduce this only on webkit browsers (Chrome and Safari on OS X and Chrome on Windows), no idea why Firefox is not affected. Haven't tested IE.
Looks like on any page where TinyMCE is used (Edit Post, Page, CPTs, etc.) TinyMCE gets the focus when initialised and the cursor is placed inside the editor area. On Chrome, when a post has a very long content, this causes also the page to scroll.
Reverting [37906] fixes it for me. As far as I see, this line
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/js/tinymce/plugins/wplink/plugin.js?rev=37906#L573
always runs the wp_link_cancel
command when TinyMCE initialises. Really not a TinyMCE expert here :) but quickly looking at the TinyMCE source I see that execCommand()
always tries to focus the editor except for a few cases.
Confirmed. Fix coming up.