#260: pin button width during copy feedback so neighbors never jump
CI / test (pull_request) Successful in 22s
CI / docker (pull_request) Skipped

This commit is contained in:
fen
2026-09-17 14:47:34 -05:00
parent 1872dac8b4
commit 11cf7428eb
2 changed files with 10 additions and 1 deletions
+4 -1
View File
@@ -199,8 +199,11 @@ function finishCreate(data) {
try {
navigator.clipboard.writeText(url);
copyBtn.classList.add('ok'); // in-place success feedback (#53)
// #260: pin the pre-swap width so the wider/narrower glyph never
// shifts neighbouring elements; release it when the label restores.
copyBtn.style.minWidth = Math.ceil(copyBtn.getBoundingClientRect().width) + 'px';
copyBtn.textContent = '✓';
setTimeout(() => { copyBtn.classList.remove('ok'); copyBtn.textContent = '⧉'; }, 2000);
setTimeout(() => { copyBtn.classList.remove('ok'); copyBtn.textContent = '⧉'; copyBtn.style.minWidth = ''; }, 2000);
} catch(e) { toast('Copy failed', 'error'); }
});
// token carried via sessionStorage, never in the URL (#143)