vue-panzoom icon indicating copy to clipboard operation
vue-panzoom copied to clipboard

Deal with `#text` nodes from whitespaces

Open walmon opened this issue 3 years ago • 0 comments

Depending on the build setup whitespaces will potentially be turned into #text nodes, so when querying for the first child node as the current code does it breaks the plugin. Instead, it should ignore #text nodes and pick the node that the user actually intended to be used.

This change should not break setups where whitespaces are not kept and therefore turned into #text nodes as if there's a single node, then the system will take that instance anyway (same as it used to do with firstChild.

See mdn reference.

walmon avatar Oct 11 '22 18:10 walmon