Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: Form filters reset scroll position (#4267)

Ivan Starkovc1041f7eb54d
diff --git a/packages/sdk-components-react-remix/src/remix-form.tsx b/packages/sdk-components-react-remix/src/remix-form.tsx
index 0328240c6b..abb73c5145 100644
--- a/packages/sdk-components-react-remix/src/remix-form.tsx
+++ b/packages/sdk-components-react-remix/src/remix-form.tsx
@@ -30,7 +30,15 @@ export const RemixForm = forwardRef<
// which makes it hard to handle intercepted submit events
// render remix form only in published sites
if (renderer !== "canvas" && renderer !== "preview") {
- return <Form action={action} {...props} ref={ref} />;
+ return (
+ <Form
+ action={action}
+ {...props}
+ ref={ref}
+ // Preserve scroll position for navigation on the same path, as it's used for filtering and sorting
+ preventScrollReset={action === undefined || action === ""}
+ />
+ );
}
}
return <form {...props} ref={ref} />;