Skip to content

Commit 5317798

Browse files
committed
better check
1 parent 3a8a989 commit 5317798

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/astro/src/transitions/router.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ async function updateDOM(
305305
activeElement instanceof HTMLInputElement ||
306306
activeElement instanceof HTMLTextAreaElement
307307
) {
308-
start && (activeElement.selectionStart = start);
309-
end && (activeElement.selectionEnd = end);
308+
if (typeof start === 'number') activeElement.selectionStart = start;
309+
if (typeof end === 'number') activeElement.selectionEnd = end;
310310
}
311311
}
312312
};

0 commit comments

Comments
 (0)