diff --git a/script.js b/script.js index da67351..c786c47 100644 --- a/script.js +++ b/script.js @@ -940,7 +940,7 @@ function goToNow() { function enterEdit() { const span = document.getElementById('cobieTime'); - const val = span.textContent; + const val = span.textContent; const input = document.createElement('input'); input.id = 'cobieInput'; input.value = val; @@ -950,6 +950,9 @@ function enterEdit() { input.style.color = 'inherit'; input.style.textAlign = 'center'; input.style.width = '12ch'; + // keep the input visually centered like the original span + input.style.display = 'block'; + input.style.margin = '0 auto'; span.replaceWith(input); input.focus(); input.setSelectionRange(1, val.length);