ni / nimble

The NI Nimble Design System
https://nimble.ni.dev
MIT License
32 stars 8 forks source link

Improve nimble-dialog handling of detached state #677

Closed m-akinc closed 8 months ago

m-akinc commented 2 years ago

🧹 Tech Debt

From discussion here: https://github.com/ni/nimble/pull/658#discussion_r942539836

The Nimble dialog needs logic to handle:

You should be able to disconnect (while the dialog is open), reconnect, and re-open the dialog.

Any new scenarios handled need tests as well.

rajsite commented 2 years ago

A theoretical use case for detachment re-use came up for Angular applications / SPAs that have dom snippets cached and re-used multiple times. ie a nimble-dialog is initialized with content, attached to the dom, goes through the open / close lifecycle, and is removed.

In the Anguar / SPA scenario, lets say the dialog is opened and a router event occurs (action in dialog causes routing event), the dialog would be detached from the dom immediately. Theoretically if the element was cached for efficiency it may need to be re-used / detachment should leave it in a good state.

In practice currently the dialog is not cached so the disconnected state / behavior is not a known issue / requirement for apps yet. See AzDo discussion.

jattasNI commented 8 months ago

Closing in favor of #1769