• Ryan Landay's avatar
    Make DPAD_CENTER key events show soft input on keyup, not keydown · a9a6608f
    Ryan Landay authored
    When a native Android EditText widget is focused, the DPAD_CENTER keyboard event
    (e.g. from the center button on the Nexus Player remote) causes the on-screen
    keyboard to show on keyup. Currently in WebView, we're showing the keyboard on
    keydown, and then the on-screen keyboard is receiving the keyup event. In
    Android Oreo, the keyboard was rewritten and when the new keyboard receives this
    keyup event, it types the character selected by default on the keyboard (usually
    '1').
    
    The fix is to not show the keyboard until keyup, to match the behavior of
    Android EditText. Despite no longer doing anything in response to the keydown
    event, we still want to make the event prevent default instead of passing it to
    the web app, since passing it to the web app would cause compatibility problems.
    E.g. the Facebook app for Android TV would blur the input element in response to
    the keydown immediately after the keyboard is opened (which causes the keyboard
    to close again).
    
    Bug: 776591
    Change-Id: Icf893f8d2ef27825d78d2bc264575a62b0e77648
    Reviewed-on: https://chromium-review.googlesource.com/729281Reviewed-by: default avatarAlexandre Elias <aelias@chromium.org>
    Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
    Commit-Queue: Ryan Landay <rlanday@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#510277}
    a9a6608f
render_widget_input_handler.cc 17.2 KB