Describe the Bug
The RichText component's routeHandler method builds the navigation destination using only target.pathname and target.hash, omitting target.search. Internal links with query parameters lose their query string during client-side routing.
const destination = target.hash ? `${target.pathname}${target.hash}` : target.pathname;
To Reproduce
- Add an internal link with query parameters to a Rich Text field in Sitecore, e.g.
/my-page?type=foo§ion=bar
- Render it using the Rich Text component in a Vue 3 JSS app
- Click the link
- The app navigates to
/my-page and query parameters are stripped
Expected Behavior
The full URL including query string should be preserved during SPA routing
Possible Fix
Include target.search alongside with the target.hash and target.pathname
Provide environment information
- Sitecore Version: 10.4.1 + JSS 22.0 (Headless)
- JSS Version: @sitecore-jss/sitecore-jss-vue 22.9.1
- Browser Name and version: not browser specific
- Operating System and version (desktop or mobile): not OS specific
- Link to your project (if available): N/A
Describe the Bug
The RichText component's routeHandler method builds the navigation destination using only
target.pathnameandtarget.hash, omittingtarget.search. Internal links with query parameters lose their query string during client-side routing.To Reproduce
/my-page?type=foo§ion=bar/my-pageand query parameters are strippedExpected Behavior
The full URL including query string should be preserved during SPA routing
Possible Fix
Include
target.searchalongside with thetarget.hashandtarget.pathnameProvide environment information