Bug 196336 - [macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
Summary: [macOS] Select element doesn't show popup if select element had lost focus wh...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-03-27 19:56 PDT by Ryosuke Niwa
Modified: 2019-03-27 23:22 PDT (History)
4 users (show)

See Also:


Attachments
Fixes the bug (18.60 KB, patch)
2019-03-27 20:52 PDT, Ryosuke Niwa
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>