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

[Bug]: BrowserMod action: fire-dom-event removed from editor #1392

Open
3 tasks done
binarybucks opened this issue Mar 15, 2024 · 1 comment
Open
3 tasks done

[Bug]: BrowserMod action: fire-dom-event removed from editor #1392

binarybucks opened this issue Mar 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@binarybucks
Copy link

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest Mushroom version.
  • I did a search to see if there is a similar issue or if a pull request is open.
  • I have read the state of card mod support (in pin issues) and understand card mod support is not provided in this repository.

Current Behavior

When trying to add browser mod popups to existing cards, the added action and popup code sometimes gets removed in the code editor due to the unsupported tap_action.

image

According to #490 action: "fire-dom-event" should be working in the code editor.

Expected Behavior

Code editor should not remove any code if some action is unknown

Steps To Reproduce

Create a new mushroom card e.g. entity-card and switch to code editor and add a tap_action with action: fire-dom-event e.g.

type: custom:mushroom-entity-card
entity: person.home
fill_container: true
tap_action:
  action: fire-dom-event
  browser_mod:
    service: browser_mod.popup
    data:
      title: Popup example
      content:
        type: entities
        entities:
          - person.home 

The card saves correctly and the popup also works when saving the card.

Open the card configuration again, switch to the code editor and change tap_action to e.g. hold_action.
The code instantly changes to action: '' and removes all other code for that action

image

Copy/pasting the tap_action to other cards also only pastes action: ''

Context

YAML state

Environment

- Browser: Edge 122.0.2365.66
- HA Version: 2024.3.0
- Mushroom: 3.5.2

Anything else?

No response

@binarybucks binarybucks added the bug Something isn't working label Mar 15, 2024
@Syntoxr
Copy link

Syntoxr commented May 12, 2024

Having a similar issue.

  • I'm using a template card inside a grid. (if that is any help)
  • When editing the template card, the full code gets shown, and I am able to recreate the mentioned issue.
  • Additionally (the reason I found this issue report), if I now edit another template card and go back to editing the template card with fire-dom-event, I get the above-mentioned error.
  • I've tested the following switching situations with DOM as a placeholder for the template card with fire-dom-event:
    • DOM -> template without fire-dom-event -> DOM : Error occurs
    • DOM -> copied DOM -> DOM : NO error occurs
    • DOM -> mushroom-chips-card -> DOM : NO error occurs
    • DOM -> mushroom-climate-card -> DOM : NO error occurs
    • DOM -> native area card -> DOM : NO error occurs
  • All the cards were in the same grid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants