Skip to content

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

Closed

Description

@luncheon

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.)

Activity

  1. added
    select
    on Mar 16, 2022
  2. dandclark commented on Mar 16, 2022

    @dandclark
    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).

  3. added
    agenda+
    on Mar 16, 2022
  4. dandclark commented on Mar 16, 2022

    @dandclark
    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).

  5. added
    popover
    on Mar 31, 2022
  6. mfreed7 commented on Mar 31, 2022

    @mfreed7
    Collaborator

    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?

  7. css-meeting-bot commented on Apr 7, 2022

    @css-meeting-bot

    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
  8. mfreed7 commented on Apr 7, 2022

    @mfreed7
    Collaborator

    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.

  9. added
    needs edits
    and removed
    agenda+
    on Apr 10, 2022
  10. mfreed7 commented on Apr 27, 2022

    @mfreed7
    Collaborator

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs editspopoverselect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions