popups opened from a panel cause the panel to close

UNCONFIRMED
Unassigned

Status

()

UNCONFIRMED
2 years ago
5 months ago

People

(Reporter: blask, Unassigned)

Tracking

54 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0
Build ID: 20170612122310

Steps to reproduce:

Create a webextension with a toolbar button that bring up an options popup:

    "browser_action": {
        "browser_style": false,
        "default_icon": "icon.svg",
        "default_popup": "options/options.html",
        "default_title": "__MSG_browserActionLabelDefault__"
    },

Add an input with type color.
Click the button and then the color chooser.


Actual results:

The color chooser comes up, but the options popup disappears. So whatever color you choose, it's not applied in the options popup, making the input unusable.


Expected results:

The options popup should stay up and the chosen color should be applied to the input element. (Works like this in Chrome)

Updated

2 years ago
Component: Untriaged → WebExtensions: Untriaged
Product: Firefox → Toolkit
Summary: Can't use input type color in options popup → Can't use input type color in popup

Updated

2 years ago
Assignee: nobody → mixedpuppy
Priority: -- → P3
Whiteboard: investigate
Some clarity on the STR.

When any popup is opened from a panel, the panel is closed.  In this case, the color picker opens causing the panel to close, thus you are unable to select a color using this mechanism.  This is a long standing issue with our panels, and really any input element would work, for example a file picker.
Summary: Can't use input type color in popup → popups opened from a panel cause the panel to close
There is no current workaround for this, it would require a change in the panel code to make something general.
Assignee: mixedpuppy → nobody
Priority: P3 → --
Whiteboard: investigate

Updated

2 years ago
Component: WebExtensions: Untriaged → General
Product: Toolkit → Core

Comment 3

2 years ago
Please don't put random webextensions bugs in the xul component.
Component: XUL → WebExtensions: General
Product: Core → Toolkit

Updated

2 years ago
status-firefox57: --- → wontfix

Updated

8 months ago
Product: Toolkit → WebExtensions
(In reply to Neil Deakin from comment #3)
> Please don't put random webextensions bugs in the xul component.

This isn't a random webextension bug.  Panels close when a sub-panel is opened, nothing to do with webextensions.  Where do you propose this goes?
status-firefox57: wontfix → ---
Flags: needinfo?(enndeakin)

Comment 5

6 months ago
OK, so a testcase would have helped here.

Chrome seems to keep the popup panel open until you either click outside on the same window or press Escape, but doesn't close it in any other case, for example clicking on some other window. Some behaviour, I would consider a bug, for example, right-clicking on the url bar leaves the panel open, makes the urlbar look focused, but doesn't allow one to type in it. Chrome also leaves the color picker open even when the panel is closed.

I think you would need to decide on what conditions the panel is expected to remain open and on which conditions it would be closed. Generally our behaviour is to either close panels always when one switches to some other UI or application, or to never close them.
Flags: needinfo?(enndeakin)
This issue has always existed in popups, its more prevalent because of webextensions, but it's still a xul/panel issue.  What component can we put this into?
Flags: needinfo?(enndeakin)

Comment 7

5 months ago
Well, there are three options here (assuming do nothing isn't one of them):

1. Never hide the panel automatically for panels that need this. This is easily done by making the panel noautohide. I assume though that the extensions system wouldn't know whether to do this or not.
3. Use the Chrome approach which is similar to 1, but something is added which closes the popup when clicking in the browser window. This is the most hacky of the solutions. I think this code would still be added to the extensions panel specifically.
2. Add something to the colourpicker form control so that it checks if it is inside a panel and prevents the panel from closing while the colourpicker is being opened. This code would be added to the form controls code somewhere.
Flags: needinfo?(enndeakin)
Thanks. If 1 is a non-option, and 3 is hacky, then we're looking at 2. Same question though: what component should we move that to?
Flags: needinfo?(enndeakin)

Comment 9

5 months ago
The colourpicker could look for an enclosing popup and prevent the popup from hiding while the colorpicker is being opened by cancelling the popuphiding event. This would then be 'Layout : Form Controls' if you want a solution specific to the colourpicker.

A variation would be to set something on the popup itself that could prevent it from closing. That might be advantageous if there were other situations where this was needed.
Flags: needinfo?(enndeakin)
Another example is the file picker.
(In reply to Neil Deakin from comment #9)
> The colourpicker could look for an enclosing popup and prevent the popup
> from hiding while the colorpicker is being opened by cancelling the
> popuphiding event. This would then be 'Layout : Form Controls' if you want a
> solution specific to the colourpicker.
> 
> A variation would be to set something on the popup itself that could prevent
> it from closing. That might be advantageous if there were other situations
> where this was needed.

That variation is a better solution (especially per #c10). But so far they all seem form control-y to me anyway (judging from a sub-panel that ostensibly is used to populate a value on the prior panel).
Component: General → Layout: Form Controls
Product: WebExtensions → Core
You need to log in before you can comment on or make changes to this bug.