-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[graphiql] Grafana Embedded GraphiQL Editor CodeMirror info tooltips links navigate away from page #3565
Comments
yeah that looks like something very Grafana specific! it looks like the browser native behavior where it shows the full url when hovering a link, but I'm guessing grafana adds that? have never seen this before or seen it reported in GraphiQL it could also be that grafana has added something like DOMPurify to filter all URLs for all plugins, thus the unexpected serialization? |
After some more debugging, I found the piece of code responsible for this and confirmed that this behavior happens for other "go nowhere a tags" in Grafana. First the piece of code responsible for this bug:
I created a bug report as linked above and it turns out, if you were to put an element such as Now, this is obviously a bug in Grafana, but it's worth mentioning that making href equal to This issue is probably able to be closed, but I would like to see if anyone had any thoughts on if using |
I tracked down this addition to 02a8ec9#diff-ed168189151bacb4f4f21b037ea4aeb8980fbc53a03aa6ba921f1e9f23fcdef0R167 or this: Line 167 in 02a8ec9
This was authored by @leebyron, so I was wondering if you had any insight on this? |
I got #3567 created to fix this issue. It was a pretty simple fix that shouldn't cause any problems. I tested to confirm it works in Grafana, but other than that the testing I did was pretty limited. |
* fix: prevent default behavior of clicking a tag href. Closes #3565 * added changeset
Is there an existing issue for this?
Current Behavior
When embedding a
GraphiQLInterface
inside of a Grafana query editor, any link to a part of the documentation will instead take the user tohttp://localhost:3000/javascript:void%200
, rather than actually executing whatever JavaScript is supposed to execute.Screenshot to show what I mean by "info tooltip" - the div at the bottom of the inspect window pops up and I don't really have a way to debug it because when I stop hovering, it disappears.
Expected Behavior
The links in the tooltip should open up the documentation, rather than navigate away from the current page.
Steps To Reproduce
I don't exactly know how to ask others to reproduce this since I have such a unique setup. I mostly would just like pointers on how to debug this myself. If anyone is willing to debug this:
npm run dev
mage -v build:linux && npm run server
Environment
react
Version: 18.2.0graphql
Version: 16.8.1Anything else?
This issue is a weird one to reproduce, but I would appreciate any guidance in to why this might be happening. Embedding GraphiQL into Grafana is likely something that hasn't been done before, and Grafana itself uses a fair bit of React code, so my guess is that something is conflicting with GraphiQL in a way no one expected.
I would appreciate any guidance to get this fixed, as if you navigate away, you lose whatever progress you have made while editing the dashboard.
The text was updated successfully, but these errors were encountered: