Skip to content

Commit

Permalink
fix: Incorrect Current Page link state on dynamic pages (#4266)
Browse files Browse the repository at this point in the history
## Description

closes #3560

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
  • Loading branch information
istarkov authored Oct 11, 2024
1 parent 4ee045f commit 619b0c1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export const wrapLinkComponent = (BaseLink: typeof Link) => {
// always render simple <a> in canvas and preview
// since remix links do not affect it
if (renderer !== "canvas" && renderer !== "preview") {
return <RemixLink {...props} to={href} ref={ref} />;
// In the future, we will switch to the :local-link pseudo-class (https://developer.mozilla.org/en-US/docs/Web/CSS/:local-link). (aria-current="page" is used now)
// Therefore, we decided to use end={true} (exact route matching) for all links to facilitate easier migration.
return <RemixLink {...props} to={href} ref={ref} end />;
}
}

Expand Down

0 comments on commit 619b0c1

Please sign in to comment.