WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#29944 closed defect (bug) (fixed)

When editing a long post in Text mode, clicking on any of the Quicktags buttons may auto-scroll the page

Reported by: azaozz Owned by: nacin
Milestone: 4.0.1 Priority: normal
Severity: normal Version: 4.0
Component: Editor Keywords: fixed-major commit
Focuses: Cc:

Description

Happens only in Chrome 38 (recently released) when editor expand is enabled, and only when the caret is somewhere in the middle of the post.

Attachments (1)

29944.diff (848 bytes) - added by jorbin 5 years ago.

Download all attachments as: .zip

Change History (10)

#1 @iseulde
5 years ago

Looks like this is a Chrome bug. Happens too with editor expand disabled, if you make the textarea a bit longer.

#2 @azaozz
5 years ago

Yeah, can reproduce it without editor expand too.

#3 @azaozz
5 years ago

After some quick debugging with @avryl, caused by canvas.focus(); before setting the new caret position (canvas.selectionStart and canvas.selectionEnd).

#4 @azaozz
5 years ago

  • Keywords fixed-major commit added

In [29884]:

Quicktags: move focusing the editor after inserting content to the end of the code blocks. Fixes a bug in Chrome where both the textarea and the window may auto-scroll to unexpected position on clicking a Quicktags button. Part props avryl, fixes #29944 for trunk.

#5 @SergeyBiryukov
5 years ago

  • Summary changed from When editing a long post in Text more, clicking on any of the Quicktags buttons may auto-scroll the page to When editing a long post in Text mode, clicking on any of the Quicktags buttons may auto-scroll the page

#6 @krotz
5 years ago

#30004 was marked as a duplicate.

#7 @hernangonzalez
5 years ago

#30140 was marked as a duplicate.

@jorbin
5 years ago

#8 @jorbin
5 years ago

I've tested in chrome 38 and chrome 40.

The above patch ports the change in r29884 over to the 4.0 branch and is ready to be merged.

#9 @nacin
5 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 30250:

Quicktags: move focusing the editor after inserting content to the end of the code blocks.

Merges [29884] to the 4.0 branch.

Fixes a bug in Chrome where both the textarea and the window may auto-scroll to unexpected position on clicking a Quicktags button.

props azaozz, avryl.
fixes #29944.

Note: See TracTickets for help on using tickets.