Skip to content

Don't intercept hash-only links inside frames#1508

Open
redsun82 wants to merge 1 commit intohotwired:mainfrom
redsun82:fix/hash-only-links-in-frames
Open

Don't intercept hash-only links inside frames#1508
redsun82 wants to merge 1 commit intohotwired:mainfrom
redsun82:fix/hash-only-links-in-frames

Conversation

@redsun82
Copy link
Copy Markdown

Hash-only links like <a href="#comments"> inside a <turbo-frame> were intercepted and triggered a fetch request to reload the frame, instead of letting the browser scroll to the anchor.

Skip interception for hash-only links in both FrameController#shouldInterceptNavigation and Session#willFollowLinkToLocation.

Partially addresses #598

Hash-only links (e.g. `<a href="#comments">`) inside a
`<turbo-frame>` were being intercepted, triggering a frame fetch
request instead of letting the browser scroll natively.

Skip interception in `#shouldInterceptNavigation` (frames) and
`willFollowLinkToLocation` (Drive) when the link's `href` starts
with `#`.

Fixes hotwired#598
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant