-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The clipboard icon is not shown anymore when the tick icon is clicked #40915
Open
3 tasks done
Comments
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
10 tasks
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: diff --git a/site/assets/js/partials/code-examples.js b/site/assets/js/partials/code-examples.js
index d81191a96..06bd8545c 100644
--- a/site/assets/js/partials/code-examples.js
+++ b/site/assets/js/partials/code-examples.js
@@ -63,6 +63,11 @@ export default () => {
const namespace = 'http://www.w3.org/1999/xlink'
const originalXhref = iconFirstChild.getAttributeNS(namespace, 'href')
const originalTitle = event.trigger.title
+ const isCheckIconVisible = originalXhref === '#check2'
+
+ if (isCheckIconVisible) {
+ return
+ }
tooltipBtn.setContent({ '.tooltip-inner': 'Copied!' })
event.trigger.addEventListener('hidden.bs.tooltip', () => { Feel free to create a PR with that option @MohamadSalman11, and we'll see if anyone from the JS team has a different or better approach in mind :) |
10 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: