You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Incremental DOM does not see element attribute changes made by external libraries. In some way, the <details> element behaves like an external library, because clicks on it will toggle an open attribute on the element. Incremental DOM does not see the attribute changes.
Usually this behaviour is ok, because it allows one to open and close a details element without having to manage the state with javascript. This is possible by not putting "open" attributes in the element when rendering. That way Incremental DOM will not cache the "open" attribute and leave the state handling to the browser.
However... When the details element is already on the page, and the nodes not yet imported by Incremental DOM, it will cache the "open" attribute for any details summary field the user has openend. Those detail elements will be closed the next time the elements are rendered.
Is it possible to not cache the "open" attribute, and let that attribute be set and unset by the browser?
The text was updated successfully, but these errors were encountered:
The details element is the only element I know which changes its own dom representation.
mmzeeman
changed the title
Details disclosure element <details> adds and removes "open" outside of incrementalDOM
Details disclosure element <details> adds and removes "open" attribute outside of incrementalDOM
Jun 8, 2021
Incremental DOM does not see element attribute changes made by external libraries. In some way, the
<details>
element behaves like an external library, because clicks on it will toggle anopen
attribute on the element. Incremental DOM does not see the attribute changes.Usually this behaviour is ok, because it allows one to open and close a details element without having to manage the state with javascript. This is possible by not putting "open" attributes in the element when rendering. That way Incremental DOM will not cache the "open" attribute and leave the state handling to the browser.
However... When the details element is already on the page, and the nodes not yet imported by Incremental DOM, it will cache the "open" attribute for any details summary field the user has openend. Those detail elements will be closed the next time the elements are rendered.
Is it possible to not cache the "open" attribute, and let that attribute be set and unset by the browser?
The text was updated successfully, but these errors were encountered: