]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
code-examples.js: switch to `firstElementChild` (#37570)
authorXhmikosR <xhmikosr@gmail.com>
Thu, 1 Dec 2022 18:14:33 +0000 (20:14 +0200)
committerGitHub <noreply@github.com>
Thu, 1 Dec 2022 18:14:33 +0000 (20:14 +0200)
This ensures that we will get the first element child and not text

site/assets/js/code-examples.js

index 25486c2fe78e53a7b35d927977501fe3f29eac0b..edb13598fdebb3553c7d2d8d1347769cf98d52d8 100644 (file)
@@ -56,7 +56,7 @@
   })
 
   clipboard.on('success', event => {
-    const iconFirstChild = event.trigger.querySelector('.bi').firstChild
+    const iconFirstChild = event.trigger.querySelector('.bi').firstElementChild
     const tooltipBtn = bootstrap.Tooltip.getInstance(event.trigger)
     const namespace = 'http://www.w3.org/1999/xlink'
     const originalXhref = iconFirstChild.getAttributeNS(namespace, 'href')