#52046 closed defect (bug) (fixed)
The Distraction Free Writing setting on the old Edit Post screen may be reset after page reload
Reported by: | azaozz | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.6.1 | Priority: | normal |
Severity: | normal | Version: | 5.6 |
Component: | Editor | Keywords: | fixed-major |
Focuses: | Cc: |
Description
Happens only in Firefox as reported at: https://wordpress.org/support/topic/scroll-doesnt-work-in-firefox/.
Clicking "Enable full-height editor and distraction-free functionality" in Screen Options on the old Edit Post screen would set "dfw mode" to on, but after couple of page reloads the checkbox appears checked but the setting is "off".
Attachments (1)
Change History (12)
#3
@
4 years ago
Think I (finally) got to the bottom of it. Looks like it is a timing issue (no surprise) of the 'tinymce-editor-init'
custom jQuery event. Not sure why it only happens in Firefox but potentially can happen in any browser.
Problem is that event is triggered asynchronously/independently of the DOM loading, but several of the callbacks are attached on DOM ready. For some reason after the TinyMCE and jQuery updates the order there has changed a bit and now 'tinymce-editor-init'
for the main editor on the old Edit Post screen may fire before DOM ready so several callbacks don't get executed. One of these callbacks is for making the toolbar "sticky" and setting/resetting "dfw mode". Patch coming up.
#4
@
4 years ago
- Keywords has-patch needs-testing added; needs-patch removed
In 52046.diff: Trigger the tinymce-editor-init
custom jQuery event on DOM ready. Otherwise TinyMCE may initialize earlier and handlers attached on DOM ready may not get triggered.
Please test!
#5
@
4 years ago
- Resolution set to fixed
- Status changed from new to closed
Changeset [49911].
Editor: Trigger the tinymce-editor-init custom jQuery event on DOM ready. Otherwise TinyMCE may initialize earlier and handlers attached on DOM ready may not get triggered. Fixes making the editor menu "sticky" and setting/resetting some screen options on the old Edit Post screen.
Fixes 52046, 51995.
#6
@
4 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Reopen for the 5.6 branch.
This ticket was mentioned in Slack in #core by metalandcoffee. View the logs.
4 years ago
#9
@
4 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from reopened to closed
In 49996:
#10
@
4 years ago
I'm recopying here what I wrote in other tickets. Not sure but this could explain the problem, asynchronous firing with jQuery3: https://github.com/jquery/jquery/issues/3194
With jQuery3, ready
handlers fire asynchronously and may be fired after load
... there's no guarantee so that can explain some "random" behaviors.
Long story short, the load
trigger should never be set in the ready
callback but outside. Ideally it should even be avoided when using ready
.
Setting tentatively to 5.6.1 pending a patch.