You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clipboard.on('success',event=>{consticonFirstChild=event.trigger.querySelector('.bi').firstElementChildconsttooltipBtn=bootstrap.Tooltip.getInstance(event.trigger)constnamespace='http://www.w3.org/1999/xlink'constoriginalXhref=iconFirstChild.getAttributeNS(namespace,'href')constoriginalTitle=event.trigger.title// Check if the tick icon is currently visible; if so, return (A possible solution)>if(originalXhref==='#check2'){>return>}tooltipBtn.setContent({'.tooltip-inner': 'Copied!'})event.trigger.addEventListener('hidden.bs.tooltip',()=>{tooltipBtn.setContent({'.tooltip-inner': btnTitle})},{once: true})event.clearSelection()iconFirstChild.setAttributeNS(namespace,'href',originalXhref.replace('clipboard','check2'))setTimeout(()=>{iconFirstChild.setAttributeNS(namespace,'href',originalXhref)event.trigger.title=originalTitle},2000)})
Or
clipboard.on('success',event=>{
...
constisCheckIconVisible=originalXhref==='#check2'// To make the code a bit clearerif(isCheckIconVisible){return}...})
After Implementing the Solution:
screen-recording.mp4
Did you prefer the first way to solve this or the second one? If you have any other solutions or alternative ways to approach this issue, don’t hesitate to share! 😊💡
Reduced test cases
None
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
5.3.3
The text was updated successfully, but these errors were encountered:
MohamadSalman11
changed the title
Clipboard icon not shown anymore when clicked during copying
Clipboard icon not shown anymore when clicked tick icon
Oct 7, 2024
MohamadSalman11
changed the title
Clipboard icon not shown anymore when clicked tick icon
The clipboard icon is not shown anymore when the tick icon is clicked
Oct 7, 2024
IMHO, it's probably not worth spending too much time trying to find an alternative approach, as this is an edge case only in the documentation. I haven't checked it locally but I'd suggest going with the second option, which is likely more readable:
Prerequisites
Describe the issue
The clipboard icon is not showing anymore when the user clicks on the tick after it has been copied. The video below demonstrates the issue.
Normal behavior when not clicking on the tick:
screen-recording.mp4
When clicking on the tick after it has been copied:
screen-recording.mp4
We can solve the problem as follows:
bootstrap/site/assets/js/partials/code-examples.js
Or
After Implementing the Solution:
screen-recording.mp4
Did you prefer the first way to solve this or the second one? If you have any other solutions or alternative ways to approach this issue, don’t hesitate to share! 😊💡
Reduced test cases
None
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
5.3.3
The text was updated successfully, but these errors were encountered: