thomasloven / hass-browser_mod

🔹 A Home Assistant integration to turn your browser into a controllable entity and media player
MIT License
1.33k stars 186 forks source link

Issues/unexpected behaviour when triggering popup within popup #520

Open adabelleleiram opened 1 year ago

adabelleleiram commented 1 year ago

My Home Assistant version: 2023.1.0

What I am doing: I would like to be able to open a popup from within another popup. In my case, I have a light group that I want to be able to expand. For the hold action of the light group, I trigger a popup that shows a list of all the entities in that group. Holding on each entity brings up another popup. If that entity is a group, it would expand that one too, otherwise show more-info for that light.

What I expected to happen: To be able to open each popup with a hold action. When I close each popup, I expect to return to the previous popup.

What happened instead: On mobile (both companion app and Chrome), I have to do the hold action twice within the first popup to open the second popup: https://user-images.githubusercontent.com/28298971/213862640-7cf5c40c-ff9f-4d5a-b139-38b6d72af636.mp4

This doesn't happen on my computer in Chrome (not even with mobile layout in dev tools).

When I close popup 2, I'm sent back to the main view. This happens on mobile and on my computer.

Minimal steps to reproduce:

# The least amount of code or steps possible to reproduce my error
type: button
entity: light.dining_room_light
hold_action:
  action: fire-dom-event
  browser_mod:
    service: browser_mod.popup
    data:
      title: Popup 1
      content:
        type: horizontal-stack
        cards:
          - type: button
            entity: light.dining_room_pendant_up
            hold_action:
              action: fire-dom-event
              browser_mod:
                service: browser_mod.popup
                data:
                  title: Popup 2
                  content:
                    type: custom:more-info-card
                    title: "Popup 2"
                    entity: light.dining_room_pendant_up

# Put your code/steps here

Error messages from the browser console: Nothing on computer. Can't check on mobile...?

// Select everything from the browser console and copy it

// Paste it here

By replacing the space in the checkboxes ([ ]) with an X below, I indicate that I:

jherby2k commented 1 year ago

I've added a media-control card to a popup and noticed the Browse Media button doesn't work. I think that's essentially the same issue - popup from within a popup.

Kilill commented 1 year ago

Have similar issue with scheduler card, where it is normally possible to click on the title/status line to open the schedule as popup. But if the scheduler card opened via a browser-mod popup it is no longer possible to open the schedule popup.

jr-k commented 1 year ago

Same issue here @Kilill .... @thomasloven any idea ?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

adabelleleiram commented 1 year ago

I assume this hasn't been fixed..? Commenting so this doesn't get closed

thomasloven commented 1 year ago

Please try now.

adabelleleiram commented 1 year ago

Please try now.

Great to hear that you've fixed it! I unfortunately can't test it at the moment due to this issue: https://github.com/thomasloven/lovelace-more-info-card/issues/23

If you have a chance to look at that one too at some point, I can verify them both :)

deadlypantsd commented 1 year ago

Thomas, I am having the same issue here. 'parent' popup is closed when firing popup from it.

adabelleleiram commented 11 months ago

Hi @thomasloven ,

Sorry it took me so long but I've finally given it a try. I'm unfortunately still having the same issue (I open two "nested" popups, clicking back does nothing, clicking backing again takes me to the start). It's like it doesn't close the second popup (maybe it closes the first one underneath the second popup so I don't see anything happen...?).