WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
141758
Finding an option in a select element shouldn't be reset when the user types a space
https://bugs.webkit.org/show_bug.cgi?id=141758
Summary
Finding an option in a select element shouldn't be reset when the user types ...
Adele Peterson
Reported
2015-02-18 09:21:35 PST
Created
attachment 246820
[details]
Test case Finding an option in a select element shouldn't be reset when the user types a space. Steps to reproduce: 1) Load the attached test case 2) Hit tab twice to focus the select element 3) Type "United S" When you hit the space, the search string is reset, and when you next type "S", "Spain" is selected. I expect "United States" to be selected. Firefox behaves correctly, Chrome matches our behavior.
Attachments
Test case
(159 bytes, text/html)
2015-02-18 09:21 PST
,
Adele Peterson
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Adele Peterson
Comment 1
2015-02-18 09:33:12 PST
rdar://problem/19875341
Adele Peterson
Comment 2
2015-02-22 21:12:09 PST
WebKit considers the event to be handled once the popup opens. I played around with trying to call typeAheadFind before opening the menu, but that doesn't really help. The searching WebKit does in the select element before the menu opens is separate from any searching that happens after the menu is open (which I think is handled by AppKit). So even if WebKit's search string includes the space, it doesn't help because the AppKit menu doesn't know anything about the characters that were typed before the menu was opened. So I think the challenge here is to find a way to pass this info along.
Abhijeet Kandalkar
Comment 3
2015-04-02 03:03:59 PDT
Related chromium issue :
https://code.google.com/p/chromium/issues/detail?id=473050
Ahmad Saleem
Comment 4
2022-09-18 03:27:53 PDT
I think this is added already here:
https://github.com/WebKit/WebKit/blob/5a8883c75f0a425515a601a4eb8de66e88ada97d/Source/WebCore/html/HTMLSelectElement.cpp#L1213
rniwa@webkit.org
- Can you confirm? Thanks!
Ryosuke Niwa
Comment 5
2022-09-18 18:47:52 PDT
The issue still reproduces in Safari whereas Chrome & Firefox will select "United States" upon typing "united s". The space after "united" is opening the popup instead of changing the selection to "united states".
Ahmad Saleem
Comment 6
2023-06-16 09:48:02 PDT
Potential merge -
https://src.chromium.org/viewvc/blink?view=revision&revision=193280
^ I merged locally with following changes: < In HTMLSelectElement.cpp > Line 1245: if ((keyCode == ' ' && !m_typeAhead.hasActiveSession(&keyboardEvent)) || keyCode == '\r') { in HTMLSelectElement::menuListDefaultEventHandler. _______ < In TypeAhead.h > bool hasActiveSession(KeyboardEvent*); _____ < In TypeAhead.cpp > bool TypeAhead::hasActiveSession(KeyboardEvent* event) { Seconds delta = event->timeStamp() - m_lastTypeTime; return delta <= typeAheadTimeout; } ______ This compiles but it does not fixed attached testcase. :-(
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug