Skip to content

Commit 9d183e9

Browse files
fix: clarify copy fallback handling
Co-authored-by: jamesmontemagno <1676321+jamesmontemagno@users.noreply.github.com> Agent-Logs-Url: https://github.com/copilot-dev-days/agent-lab-typescript/sessions/87511d3c-3e87-471f-8f89-7d0234d57e7d
1 parent 2d565cd commit 9d183e9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

docs/step.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@
214214
textarea.style.left = '-9999px';
215215
document.body.appendChild(textarea);
216216
textarea.select();
217+
// Keep the deprecated fallback for older browsers that lack navigator.clipboard.
217218
const copied = document.execCommand('copy');
218219
document.body.removeChild(textarea);
219220
if (!copied) throw new Error('Fallback copy failed');
@@ -238,7 +239,7 @@
238239
const liveRegion = document.createElement('span');
239240
liveRegion.className = 'sr-only';
240241
liveRegion.setAttribute('aria-live', 'polite');
241-
let resetTimer;
242+
let resetTimer = null;
242243

243244
const resetButtonState = () => {
244245
copyButton.textContent = 'Copy';
@@ -265,6 +266,7 @@
265266

266267
resetTimer = setTimeout(() => {
267268
pendingCopyResetTimers.delete(resetTimer);
269+
resetTimer = null;
268270
resetButtonState();
269271
}, COPY_STATUS_RESET_DELAY);
270272
pendingCopyResetTimers.add(resetTimer);

0 commit comments

Comments
 (0)