Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the 'click' listener of view transitions to handle links in SVGs and areas in image maps #9140

Merged
merged 2 commits into from
Nov 20, 2023

Conversation

martrapp
Copy link
Member

Changes

Currently we only trigger view transitions for clicks on or within HTMLAnchorElements.
This excludes <a href="" ...> within SVG elements, which are technically not HTMLElements but SVGAElements, see #9001. This change fixes that issue and now also includes HTMLAreaElements, so you also get view transitions when you click inside your beloved image maps.

Closes #9001

Testing

Added e2e test cases

Docs

Most users will not recognize the difference between an <a href= inside or outside of <svg>...</svg>. So this part is not really an extension, but a bug fix. The support for image maps is an extension, but of a more theoretical nature. It is said that they were last used in the 90s.

Copy link

changeset-bot bot commented Nov 20, 2023

🦋 Changeset detected

Latest commit: fe72ebb

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review labels Nov 20, 2023
@martrapp martrapp requested a review from matthewp November 20, 2023 14:11
Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@martrapp martrapp merged commit 7742fd7 into main Nov 20, 2023
13 checks passed
@martrapp martrapp deleted the mt/all_hrefs branch November 20, 2023 20:10
@astrobot-houston astrobot-houston mentioned this pull request Nov 20, 2023
natemoo-re pushed a commit that referenced this pull request Nov 22, 2023
…Gs and areas in image maps (#9140)

* handle clicks on SVGAElements and image maps

* add changeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using ViewTransitions API from SVG element
2 participants