slipx06 / sunsynk-power-flow-card

⚡A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.
MIT License
161 stars 48 forks source link

fix: editor restructure #459

Closed Pho3niX90 closed 1 month ago

Pho3niX90 commented 1 month ago

fixes: #450

Pho3niX90 commented 1 month ago

@slipx06 can you see if this fixes the issue for you? tested it on android and chrome on my side. Just make sure the popups are working as they should

slipx06 commented 1 month ago

Thanks but still not working for me. Tested in Edge and Chrome

slipx06 commented 1 month ago

First popup is what should happen using a different card. Second is the issue with this card

popup

Pho3niX90 commented 1 month ago

@slipx06 okay this is a strange one. from what I can tell, something is happening in the dom that is causing this behaviors, if I open a popup, close it with X, open another popup, close it, it all works. That being said, I can only reproduce this on my android device, in the companion app, it's not doing it for me on chrome windows, or chrome android.

I suspect that the animations are perhaps causing some race condition for the dom events, or perhaps some event leaking happening.

I am not near my PC to emulate the webview, I will be back on Wednesday then I will be able to properly diagnose the issue.

slipx06 commented 1 month ago

@Pho3niX90 I pushed a fix to main branch. Seems to work for me can you please check as well. On further testing it might not be. If i comment out the block below it goes away

try {
    customElements.define("content-card-editor", SunSynkCardEditor);
} catch (_e) {
}
Pho3niX90 commented 1 month ago

@slipx06 that seems to have fixed it for me on the companion app as well

Pho3niX90 commented 1 month ago

Strangly, its happening now in the chrome browser for me :/

Edit: seems to be just cache, incognito works fine

slipx06 commented 1 month ago

Yup still not working. Its really odd. If you open and close with the (x) twice then the back button works.

Pho3niX90 commented 1 month ago

@Pho3niX90 I pushed a fix to main branch. Seems to work for me can you please check as well. On further testing it might not be. If i comment out the block below it goes away

try {
    customElements.define("content-card-editor", SunSynkCardEditor);
} catch (_e) {
}

okay let me revisit this implementation. as that was a nasty workaround

Pho3niX90 commented 1 month ago

@slipx06 can you see how this acts on your system. I have combined your changes, along with cleanup of the config. thusfar it seems promising.

slipx06 commented 1 month ago

@Pho3niX90 thanks so much for working on this. Seems to be working great. Want to test it without my changes as they may not be needed.

Edit: Seems to also need the updated code I posted.

slipx06 commented 1 month ago

Tested and working in chrome, firefox, edge and companion app 🎆

floschad commented 1 month ago

Tested and working in chrome, firefox, edge and companion app 🎆

It works, thanks for the great work!