Skip to content

Binding an empty dataset respects :empty selector

Choose a tag to compare

@g105b g105b released this 15 Jan 09:01
ec45af4

If an element has no children, and bindList() is called, passing in an empty dataset, the element has its innerHTML set to an empty string to clear up any hanging text fragments. This means that now, CSS's :empty pseudo-selector can be used to display an element differently when it has been bound with an empty dataset.