"Dialog" open/close consistent on all connected devices

I'm coming back to using "Dialog" as @hotNipi recommended.
(I missed using the thread Modal element above others -- Platform problem - #8 by hotNipi - it was closed 5h ago)

Dialog solves the problem of windows not stacking the same across platforms (namely Apple).

But the dialog also opens on all active devices, which is not wanted in my particular use case. Also, if I close the dialog on one device with the dialog.close call, it only closes on that one device, the other devices stay with the dialog open.

Any idea to get it consistent, say open and close it on all or just on the one device the user is using.

The close is instigated by the user on the browser which is why it only happens in 1 place.

For the open, if you send that from Node-RED, it is, by default, broadcast to all connected clients.

Look in the Dashboard docs for how to target a single connection using the socket id. Just note that the socket id isn't all that stable and so you may need to manage the client connections/disconnections and possibly somehow add a more stable identifier to match against the socket id. This is why UIBUILDER has an additional client id that remains stable while the browser is open and can filter on that rather than the socket id.

Sounds reasonable! The point is how to send it from NodeRed using a template .
The call I use is as follows:

        const actions = document.getElementById('deviceactions')
        actions.showModal()

The deviceactions is the code for the structure of the dialog to be displayed. And with the page <dialog>: The Dialog element - HTML: HyperText Markup Language | MDN I don't see any possibility to handle a socket

I don't really use Dashboard which is why I said to look it up in the docs. You need to include the socket id so it only goes to the one client connection.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.