PolymerElements / paper-input

A Material Design text field
https://www.webcomponents.org/element/PolymerElements/paper-input
130 stars 162 forks source link

.focus does not open the keyboard on iOS or Android #624

Closed dborkan closed 6 years ago

dborkan commented 6 years ago

Description

Calling .focus() on a paper-input element does not cause the keyboard to open on either iOS or Android

Expected outcome

The keyboard should open, so the user can immediately begin inputting text.

Actual outcome

The cursor appears blinking in the field, but with the current behavior the user must click the input to open the keyboard

Live Demo

http://jsbin.com/coqebokona/1/edit?html,output

Steps to reproduce

If you open http://jsbin.com/coqebokona/1/edit?html,output on a desktop browser, once the jsbin HTML page loads, if you type you will see the text appear in the input. On mobile browsers, the keyboard does not appear unless you click on the input.

Browsers Affected

Mobile Chrome and mobile Safari

notwaldorf commented 6 years ago

Unfortunately that seems to be a native <input> problem. Just focusing a native input doesn't open the keyboard either: http://jsbin.com/tadovep/edit?html,output

This means paper-input has no chance of doing that -- there's no imperative API for opening a keyboard, so there's no workaround we can do around that.