Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[selectmenu] button click behavior when the popup is open #486

Closed
luncheon opened this issue Mar 15, 2022 · 6 comments
Closed

[selectmenu] button click behavior when the popup is open #486

luncheon opened this issue Mar 15, 2022 · 6 comments
Labels
needs edits This is ready for edits to be made popover The Popover API select These are issues that relate to the select component

Comments

@luncheon
Copy link

luncheon commented Mar 15, 2022

Currently, in Chrome Canary, if a <selectmenu>'s button is clicked when the popup is open, the popup closes while the button is pressed and re-opens when the button is released.

open-ui_486.mp4

But I think it is preferable to close the popup on a button click when it is open, like <select>. What do you think?
(I don't know whether this is a specification or a Chromium implementation.)

@dandclark dandclark added the select These are issues that relate to the select component label Mar 16, 2022
@dandclark
Copy link
Collaborator

Thanks @luncheon for pointing this out. I agree it would make more sense to match the behavior of <select>.

The draft at https://open-ui.org/components/select is ambiguous about what the behavior should be, because it depends on whether the button's handling the click or the listbox's light dismiss behavior happens first. The order of these isn't specified.

After resolving on the desired behavior we could probably just add a note about which way it should work (and update the prototype accordingly).

@dandclark dandclark added the agenda+ Use this label if you'd like the topic to be added to the meeting agenda label Mar 16, 2022
@dandclark
Copy link
Collaborator

The decision here should probably be generalized to apply to the interaction between triggerpopup and light dismiss as defined in https://github.com/mfreed7/popup#declarative-trigger-the-triggerpopup-attribute (moving soon to open-ui via #490).

@mfreed7
Copy link
Collaborator

mfreed7 commented Mar 31, 2022

I think I'm in favor of redefining (or likely just more-carefully defining) the popup light dismiss behavior to not light dismiss if the triggerpopup-based trigger element for any popup is clicked. I can't see what the use case would be for wanting that click to hide and then immediately re-open the popup. A third possibility would be that re-clicking the trigger element hides and does not re-show the popup? But that feels fairly opinionated to be a default behavior. Perhaps for that use case, you'd avoid triggerpopup and hook things up with JS instead?

@css-meeting-bot
Copy link

The Open UI Community Group just discussed [selectmenu] button click behavior when the popup is open #486.

The full IRC log of that discussion <hdv> Topic: [selectmenu] button click behavior when the popup is open #486
<hdv> github: https://github.com//issues/486
<hdv> dandclark: we wanted the behavior if popup is open and you click on a button, we wanted the correct behavior for it to close and stay closed… we want to avoid popups close and open again
<hdv> dandclark: the order does matter
<JonathanNeal> yay on the previous toggle discussion helping assist this discussion
<hdv> masonf: I think we agreed on the behavior for it to toggle… spec wise we'll have to figure out how we do it, both in lightdismiss part of the spec, that clicking on the button is a lightdismiss behavior, agree it is something to spec
<hdv> dandclark: sounds good

@mfreed7
Copy link
Collaborator

mfreed7 commented Apr 7, 2022

Just to highlight the discussion here and on #508: the tentative conclusion we reached is that the default behavior for declaratively invoked popups is for the popup to "toggle". I.e. clicking the button will open the popup if it is currently closed, and close it if it's already open.

@gregwhitworth gregwhitworth added needs edits This is ready for edits to be made and removed agenda+ Use this label if you'd like the topic to be added to the meeting agenda labels Apr 10, 2022
@mfreed7
Copy link
Collaborator

mfreed7 commented Apr 27, 2022

We've now discussed this behavior in even more detail (e.g. see #523). The resolved behavior is that togglepopup toggles when the button is pressed, openpopup just opens, and hidepopup just hides. I'm going to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs edits This is ready for edits to be made popover The Popover API select These are issues that relate to the select component
Projects
None yet
Development

No branches or pull requests

5 participants