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
{{ message }}
Repository navigation
Clicking Copy repeatedly makes the button label flicker #49
js/copy-code.js sets the label to "Copied" and schedules a setTimeout to put it back after 1600ms. Clicking again before that fires schedules a second timer while the first is still pending, so the label reverts early and can flicker between states.
What to change
Files:js/copy-code.js
Requirements:
Keep a reference to the pending timer and clear it before starting a new one
Rapid clicks should mean the label stays "Copied" for the full period after the last click
Per button — one block's timer must not affect another's
Do not introduce a global; the existing code is an IIFE per block for a reason
Acceptance criteria
Clicking five times quickly leaves "Copied" showing for the full duration after the last click
No flicker
Two different code blocks behave independently
The clipboard still receives the right text
How to verify locally
Open any page with code blocks and click one Copy button five times in a second.
Intermediate. A small, satisfying bug with a clear reproduction.
New here? Comment /claim on this issue and a bot will assign it to you. Then read CONTRIBUTING.md.
Stuck at any point? Comment here saying what you have tried and where it stopped working — that is not an admission of failure, it is how we find out the instructions were unclear. You can also come to a PR Debug Clinic (Oct 12 or Oct 21).
Activity