Skip to content

[Bug]: Sub-menus within a on overlay trigger sp-closed for the outer overlay-trigger element #4267

@adixon-adobe

Description

@adixon-adobe
Collaborator

Code of conduct

  • I agree to follow this project's code of conduct.

Impacted component(s)

overlay-trigger

Expected behavior

I can listen to sp-closed on overlay-trigger and only get close events for that trigger

Actual behavior

If I use sp-action-menu or sp-picker in the overlay rendered by overlay-trigger, closing these menus also triggers sp-closed for the outer menu. It does look like I can match the event.target to the original trigger button, but I could see this really throwing people for a loop.

How can we reproduce this issue?

I can look at getting a simpler reproduction when I have a bit more time.

Activity

adixon-adobe

adixon-adobe commented on Apr 12, 2024

@adixon-adobe
CollaboratorAuthor

I'm not really sure if another event or better documentation is the right approach here, but it was tricky to figure this out, and I'm curious how this would work for manually triggered overlays as well.

adixon-adobe

adixon-adobe commented on Apr 12, 2024

@adixon-adobe
CollaboratorAuthor

As I think about this more, I think what I'm really asking for is an event that doesn't bubble. I just want to know if this overlay opened or closed. Using the same (bubbling) event that the overlay system gets confusing because it's less common, and surprising when you run into it.

So ideally there's be another event that doesn't bubble, which when documented should make the difference in behavior very clear. And all that said, I won't be too offended if you decide it's just simpler to improve the documentation. Just pointing out that this can be a real surprising gotcha.

Westbrook

Westbrook commented on Apr 12, 2024

@Westbrook
Contributor

Some quick documentation points:

najikahalsema

najikahalsema commented on May 22, 2024

@najikahalsema
Member

@adixon-adobe Does the above comment from Westbrook give you a path forward?

added
DocumentationIssues or PRs involving changes to documentation or documentation website
APIIssues or PRs involving API changes
and removed
triageAn issue needing triage
bugSomething isn't working
on May 22, 2024
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

    APIIssues or PRs involving API changesComponent: OverlayDocumentationIssues or PRs involving changes to documentation or documentation websiteSEV missingNeeds severity classification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Westbrook@najikahalsema@caseyisonit@adixon-adobe

        Issue actions

          [Bug]: Sub-menus within a on overlay trigger sp-closed for the outer overlay-trigger element · Issue #4267 · adobe/spectrum-web-components