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

Avoid running queries when mouse focus is changed #60

Open
Amit-Hora opened this issue Sep 8, 2023 · 1 comment
Open

Avoid running queries when mouse focus is changed #60

Amit-Hora opened this issue Sep 8, 2023 · 1 comment

Comments

@Amit-Hora
Copy link

HI Team,
This npm package is being used by trino/grafana plugin . The problem is if I am writing the Query in QueryEditor and if I click on something else , focus changes like move to next tab or click on any corner of screen the query gets executed

trinodb/grafana-trino#248

I am not getting much help on what might be causing this issue all I see is there are calls made every time focus is changed in brower console and the calls are triggered by query --
http://localhost:3000/api/ds/query

Would appreciate any help and pointers

@idastambuk
Copy link
Contributor

Hi @Amit-Hora thanks for submitting this!
I suspect this has to do with your query running onBlur (triggered here)
Since this particular component is using CodeEditor from grafana/ui, I'd suggest you instead extend the ui's CodeEditor and adjust it to not call onRunQuery() when onBlur triggers.

We have tried to move away from the pattern of running queries unless the user explicitly runs acts on it, so I'll bring it to the team that we remove that particular line. In the meantime I hope the above suggestion will work for you!

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

No branches or pull requests

2 participants