Skip to content

Commit

Permalink
code-examples.js: switch to firstElementChild (#37570)
Browse files Browse the repository at this point in the history
This ensures that we will get the first element child and not text
XhmikosR authored Dec 1, 2022

Verified

This commit was signed with the committer’s verified signature.
janicduplessis Janic Duplessis
1 parent d16efb7 commit 18fec8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion site/assets/js/code-examples.js
Original file line number Diff line number Diff line change
@@ -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')

0 comments on commit 18fec8b

Please sign in to comment.