Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#29430 closed defect (bug) (fixed)

Pressing tab to indent a list in Visual Editor causes focus to leave editor

Reported by: ipstenu's profile Ipstenu Owned by: azaozz's profile azaozz
Milestone: 4.0 Priority: normal
Severity: normal Version: 3.9
Component: TinyMCE Keywords: has-patch commit dev-reviewed
Focuses: Cc:

Description

Source: Pressing tab in TinyMCE indents lists and then leaves the field
Credit: @chrisvendiadvertisingcom

In WordPress 4.0RC1, when writing a post with a list, both ordered or unordered, if you press tab the list gets indented (a child ol/ul is created) but then focus immediately leaves TinyMCE. In 3.9, at least in Chrome, tab didn't cause indentation, it just left the field.

Because the indentation happens it appears that you should be able to keep typing which, depending what keys you press, either starts editing the title or causes a draft to be saved.

Here's a video showing the 3.9 version and the 4.0 version

Steps to reproduce

  1. Create a new post
  2. Press the ordered or unordered list button
  3. Type a word
  4. Press enter
  5. Press tab

Behavior

List gets indented and then focus jumps to Save Draft button

Expected Behavior

List gets indented, focus remains in list

OR

List does not get indented and focus jumps to Save Draft button (3.9 behavior)


My thought is it should actually indent and focus stay on the list. It works like that on http://www.tinymce.com/ right now.

Attachments (1)

29430.patch (3.9 KB) - added by azaozz 11 years ago.

Download all attachments as: .zip

Change History (6)

#1 @azaozz
11 years ago

Caused by the 'tabfocus' MCE plugin. Patch coming up.

@azaozz
11 years ago

#2 @azaozz
11 years ago

  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 4.0

In 29430.patch: check if default is prevented on pressing tab, bind the events later so when other plugins (like 'lists' and 'table') use .preventDefault(), the 'tabfocus' plugin can "see" it.

This ticket was mentioned in IRC in #wordpress-dev by helen. View the logs.


11 years ago

#4 @helen
11 years ago

  • Keywords dev-reviewed added

Fire away.

#5 @azaozz
11 years ago

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

In 29657:

TinyMCE: fix the 'tabfocus' plugin to check if default is prevented on pressing tab, bind the events later so other plugins can cancel them. Merged upstream in https://github.com/tinymce/tinymce/commit/86098b348582e1544cc208db25954d31755e6d13 together with another change.
Fixes #29430

Note: See TracTickets for help on using tickets.