1 /* - This Source Code Form is subject to the terms of the Mozilla Public
2 - License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 - You can obtain one at http://mozilla.org/MPL/2.0/. */
5 export class SelectionChangedMenulist {
6 // A menulist wrapper that will open the popup when navigating with the
7 // keyboard on Windows and trigger the provided handler when the popup
8 // is hiding. This matches the behaviour of MacOS and Linux more closely.
10 constructor(menulist, onCommand) {
11 let popup = menulist.menupopup;
14 menulist.addEventListener("command", event => {
16 if (popup.state != "open" && popup.state != "showing") {
21 popup.addEventListener("popuphiding", () => {