Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#28549 closed defect (bug) (fixed)

The editor needs to blur when opening the media modal

Reported by: iseulde's profile iseulde Owned by: azaozz's profile azaozz
Milestone: 4.0 Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch needs-testing
Focuses: Cc:

Description

On an iPhone, leaving it focussed also leaves the keyboard open.

Attachments (4)

photo.PNG (69.2 KB) - added by iseulde 9 years ago.
28549.patch (1.4 KB) - added by iseulde 9 years ago.
28549.2.patch (1.5 KB) - added by iseulde 9 years ago.
28549.3.patch (1.0 KB) - added by azaozz 9 years ago.

Download all attachments as: .zip

Change History (19)

@iseulde
9 years ago

#1 @iseulde
9 years ago

Related: #27423

#2 @SergeyBiryukov
9 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

#3 @ryan
9 years ago

I encounter this every day. The keyboard gets left open or decides to fly open. I am left with a tiny little view of the modal and have to waste a tap dismissing the keyboard.

@iseulde
9 years ago

#4 @iseulde
9 years ago

  • Keywords has-patch added; needs-patch removed

I've not tested this, but theoretically blurring the editor and refocussing should work.

@iseulde
9 years ago

#5 @iseulde
9 years ago

Hm, updated the patch. Should probably not assume tinymce is defined, if the media modal is supposed to work without tinymce.js loaded.

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


9 years ago

#7 @ryan
9 years ago

With .2.patch. Focus the editor. Scroll back up to add media, retaining editor focus. Tap Add Media. Keyboard remains up. The bottom of the modal is in the narrowed view port. I must dismiss the keyboard and scroll up to get a good view. I'll post screenshots of the entire flow on an iPhone 5, soon.

#8 @ryan
9 years ago

  • Milestone Future Release deleted
  • Status changed from new to closed

#9 @ryan
9 years ago

  • Status changed from closed to reopened

#10 @ryan
9 years ago

Accidentally hit the radio to mark as duplicate. Field was empty. Milestone and Status changed.

#11 @ryan
9 years ago

  • Milestone set to Future Release

#12 @iseulde
9 years ago

Ugh. I'll take a loo at this again later... Maybe blurring the activeElement instead works.
https://developer.mozilla.org/en-US/docs/Web/API/document.activeElement

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


9 years ago

@azaozz
9 years ago

#14 @azaozz
9 years ago

  • Keywords needs-testing added
  • Milestone changed from Future Release to 4.0

Instead of blurring the editor body, we can quickly focus and blur an input field. Works for both editors and doesn't mess with MCE's focus/bookmark.

28549.3.patch tested in iOS7.1 and Android 4.4. Instead of appending another text field, we can select the first one, usually the title, but it shouldn't be hidden for this hack to work. Worst case scenario would be that this doesn't do anything.

#15 @azaozz
9 years ago

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

In 29369:

Mobile: hide the onscreen keyboard when the media modal opens, fixes #28549.

Note: See TracTickets for help on using tickets.