Bug 196336

Summary: [macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: FormsAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, simon.fraser, thorton, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Fixes the bug thorton: review+

Description Ryosuke Niwa 2019-03-27 19:56:11 PDT
In the following example, when the select element loses focus while the popup is shown,
clicking on the select element again does not open the popup.

<!DOCTYPE html>
<html>
<select>
    <option>foo</option>
    <option>bar</option>
</select>
<script>
const select = document.querySelector("select");
select.addEventListener("focus", () => setTimeout(() => select.blur(), 0), { once: true });
</script>
</html>
Comment 1 Ryosuke Niwa 2019-03-27 19:56:31 PDT
<rdar://problem/47290452>
Comment 2 Ryosuke Niwa 2019-03-27 20:52:13 PDT
Created attachment 366148 [details]
Fixes the bug
Comment 3 Tim Horton 2019-03-27 22:11:39 PDT
Comment on attachment 366148 [details]
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=366148&action=review

> Source/WebKit/ChangeLog:16
> +        to dismiss the popup over from JS seems to be flaky.

"popup" or "pop over" or "popover" but not "popup over" IMO
Comment 4 Ryosuke Niwa 2019-03-27 23:05:44 PDT
(In reply to Tim Horton from comment #3)
> Comment on attachment 366148 [details]
> Fixes the bug
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=366148&action=review
> 
> > Source/WebKit/ChangeLog:16
> > +        to dismiss the popup over from JS seems to be flaky.
> 
> "popup" or "pop over" or "popover" but not "popup over" IMO

Oops, I forgot to remove this comment. We do have tests.
Comment 5 Ryosuke Niwa 2019-03-27 23:22:44 PDT
Committed r243601: <https://trac.webkit.org/changeset/243601>