This commit adds support for a key="some-key" attribute.
When elements in a list are keyed the diffing and patching functions
will use their keys to know whether an element was removed or simply
moved.
This leads to fewer interactions with the real-DOM when modifying lists,
as well as preserving child elements when keyed elements are moved
around in the list.
This preservation is useful when you have an element that has children
that aren't managed by percy-dom.
Before this commit those children would get deleted if the element
within the list was moved.
This commit adds support for a
key="some-key"
attribute.When elements in a list are keyed the diffing and patching functions will use their keys to know whether an element was removed or simply moved.
This leads to fewer interactions with the real-DOM when modifying lists, as well as preserving child elements when keyed elements are moved around in the list.
This preservation is useful when you have an element that has children that aren't managed by percy-dom. Before this commit those children would get deleted if the element within the list was moved.