From 53177987632596778b2f248a2c094efefa3a7edb Mon Sep 17 00:00:00 2001 From: Martin Trapp <94928215+martrapp@users.noreply.github.com> Date: Tue, 16 Apr 2024 23:31:16 +0200 Subject: [PATCH] better check --- packages/astro/src/transitions/router.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/astro/src/transitions/router.ts b/packages/astro/src/transitions/router.ts index 1e97fa1c898f..a5d06d5c769c 100644 --- a/packages/astro/src/transitions/router.ts +++ b/packages/astro/src/transitions/router.ts @@ -305,8 +305,8 @@ async function updateDOM( activeElement instanceof HTMLInputElement || activeElement instanceof HTMLTextAreaElement ) { - start && (activeElement.selectionStart = start); - end && (activeElement.selectionEnd = end); + if (typeof start === 'number') activeElement.selectionStart = start; + if (typeof end === 'number') activeElement.selectionEnd = end; } } };