Mobile Safari only generates keydown, keyup, and keypress events when <textarea/> or <input type="text"/> is focused

Originator:ohnobinki
Number:rdar://15560374 Date Originated:2013-11-29
Status:Open Resolved:
Product:iOS Product Version:7.0.4 (11B554a)
Classification: Reproducible:
 
Summary:
Many webapps provide, as a convenience, functionality in response to keyboard events without requiring the user to focus an <input type="text"/> or <textarea/>. For example, there may be an HTML5 piano whose keys may be tapped directly or played by pressing particular keys on a keyboard. Another example is using an HID keyboard-compatible bluetooth barcode scanner. In both situations, if the user is using a keyboard or scanner device with the iOS device, the user will find it inconvenient to tap on the device’s screen to perform the action. For example, when using a bluetooth keyboard, the iPad may be propped up such that the user can still scroll using touch, but tapping and holding notes on a virtual piano would strain the wrists and be uncomfortable. When using a barcode scanner, the user would likely be holding a scanner in one hand and some sort of item in another hand, making it difficult to focus an <input type="text"/>.

Steps to Reproduce:
1. Configure an iOS device (e.g., iPad running iOS-7.0.4) with a bluetooth keyboard device.
2. Open Mobile Safari and navigate to http://cdn.ohnopub.net/cdn/binki/com/apple/bugreport/mobile-keyevent/mobile-keyevent.xhtml
3. Tap the Blur button to ensure that no <input type="text"/> or <textarea/> is focused.
4. Type characters on the bluetooth keyboard.

1. Configure an iOS device (e.g., iPad running iOS-7.0.4) with a bluetooth keyboard device.
2. Open Mobile Safari and navigate to http://cdn.ohnopub.net/cdn/binki/com/apple/bugreport/mobile-keyevent/mobile-date.xhtml
3. Tap the Blur button to ensure that things are blurred.
4. Type or scan a date string followed by carriage return or line feed using the bluetooth keyboard device (e.g., type “2013-11-29” and then press ENTER).

Expected Results:
See key events logged by the webapp.

See the date selector updated to correspond to the inputted date string.

Actual Results:
No key events are logged by the webapp.

The <input type="date"/> is not updated to display the inputted date.

Version:
7.0.4 (11B554a)

Notes:
http://stackoverflow.com/q/18985117/429091
http://stackoverflow.com/q/11418061/429091

Seem people suggest somehow focusing an <input/>. I guess I would have to use browser sniffing to figure that this is Mobile Safari and needs this special treatment. With the mobile-date.xhtml example, this would mean adding an additional text <input/> which would be redundant with the existing <input type="date"/>. I’m not sure how to do this without making the page ugly other than by just not using <input type="date"/> in the first place… which would mean using <input type="text"/> instead which makes input *so* much harder for touch-only users.

Configuration:
iOS-7.0.4-iPad

Occurs in Mobile Safari. According to the Internet (I have no access to Mac OSX and Desktop Safari for Windows has been discontinued), it does not occur in Desktop Safari. It does not occur in «SeaMonkey-2.22.1 on Windows» or «SeaMonkey-2.20 on Linux» or «Chromium-33.0.1723.0 (Developer Build 237851) on Windows».

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!