#260: pin button width during copy feedback so neighbors never jump
This commit is contained in:
@@ -19,6 +19,12 @@ function toggleStats() {
|
||||
function copyFeedback(btn) {
|
||||
if (!btn) return;
|
||||
if (!btn.dataset.label) btn.dataset.label = btn.textContent; // remember the original label (Copy/Link)
|
||||
// #260: keep the button width static during the feedback so surrounding
|
||||
// elements never jump. Pin the pre-swap width, release it on restore.
|
||||
if (!btn.dataset.pinned) {
|
||||
btn.style.minWidth = Math.ceil(btn.getBoundingClientRect().width) + 'px';
|
||||
btn.dataset.pinned = '1';
|
||||
}
|
||||
btn.classList.add('ok');
|
||||
btn.textContent = '✓';
|
||||
clearTimeout(btn._okh);
|
||||
|
||||
Reference in New Issue
Block a user