From 81c45f60b23519619ae0359b7b2c2bb9176d2270 Mon Sep 17 00:00:00 2001 From: Brandon Payton Date: Sun, 29 Sep 2024 13:23:36 -0400 Subject: [PATCH] Stop address bar from adding trailing slash to query params (#1820) --- .../website/src/components/address-bar/index.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/playground/website/src/components/address-bar/index.tsx b/packages/playground/website/src/components/address-bar/index.tsx index d8eb0c60f3..01d1d56181 100644 --- a/packages/playground/website/src/components/address-bar/index.tsx +++ b/packages/playground/website/src/components/address-bar/index.tsx @@ -19,12 +19,7 @@ export default function AddressBar({ url, onUpdate }: AddressBarProps) { const handleSubmit = useCallback( function (e: React.FormEvent) { e.preventDefault(); - let requestedPath = input.current!.value; - // Ensure a trailing slash when requesting directory paths - const isDirectory = !requestedPath.split('/').pop()!.includes('.'); - if (isDirectory && !requestedPath.endsWith('/')) { - requestedPath += '/'; - } + const requestedPath = input.current!.value; onUpdate?.(requestedPath); input.current!.blur(); },