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

fix: Stop a tag with href of 'javascript:void 0' from navigating #3567

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

retrodaredevil
Copy link
Contributor

I created #3565 to document a bug that I was only able to reproduce with GraphiQL embedded inside of Grafana. Some behavior or bug in Grafana was causing clicking on an a tag with an href of 'javascript:void 0' to navigate away from the page. Although this isn't supposed to happen when the href is 'javascript:void 0', this PR is a one-liner fix to this issue by calling event.preventDefault(), which prevents the default behavior of trying to navigate to javascript:void 0.

Closes #3565

Copy link

changeset-bot bot commented Mar 25, 2024

🦋 Changeset detected

Latest commit: 37d0bc2

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

This PR includes changesets to release 5 packages
Name Type
codemirror-graphql Patch
@graphiql/react Patch
@graphiql/plugin-code-exporter Patch
@graphiql/plugin-explorer Patch
graphiql Patch

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

Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 55.33%. Comparing base (7e86dc4) to head (37d0bc2).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3567      +/-   ##
==========================================
- Coverage   55.34%   55.33%   -0.02%     
==========================================
  Files         115      115              
  Lines        5348     5349       +1     
  Branches     1450     1450              
==========================================
  Hits         2960     2960              
- Misses       1962     1963       +1     
  Partials      426      426              
Files Coverage Δ
packages/codemirror-graphql/src/info.ts 0.81% <0.00%> (-0.01%) ⬇️

@acao
Copy link
Member

acao commented Mar 26, 2024

makes sense to me!

@acao acao merged commit fc7de5a into graphql:main Mar 26, 2024
14 checks passed
@acao acao mentioned this pull request Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[graphiql] Grafana Embedded GraphiQL Editor CodeMirror info tooltips links navigate away from page
2 participants