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

Modal closes when running useQuery @apollo/client #487

Open
david-rantizo opened this issue Feb 18, 2022 · 0 comments
Open

Modal closes when running useQuery @apollo/client #487

david-rantizo opened this issue Feb 18, 2022 · 0 comments
Labels

Comments

@david-rantizo
Copy link

david-rantizo commented Feb 18, 2022

Bug report

Describe the bug

When running useQuery on a handleSelect or a onClick inside the modal, it closes the modal and reopens it.

A clear and concise description of what the bug is.
I added a dropdown inside the modal which is populated by a query and each item within that query holds an id.
When the user selects on an item it would take the id value from the query and run another query using that id as a variable.
Another query runs inside the modal and it automatically closes then reopens the modal but all the selections are gone.
When all the items are selected one by one it would close and reopen again until all the items have been selected and queries have been exhausted.
Until you manually refresh the page with F5, it would then bring that issue back.

To Reproduce

These are GRARPHQL queries.
Have two queries.
One query has a name and an Id which will be populated inside a select dropdown. (useQuery)
The second query uses that id to query cars they own(or anything). (useLazyQuery)
Once the user have selected a name, you will have an onChange or onClick which will grab the useLazyQuery function and store the variable: "id" there which would force it to query the second query.

Steps to reproduce the behavior, please provide code snippets or a repository.

Expected behavior

A clear and concise description of what you expected to happen.
A user opens the modal, selects a name, then another dropdown below it will be revealed with a bunch of cars that they own.
Then we click submit for whatever we want to do next.

System information

  • Version of react-responsive-modal: latest to this date 2/18/2022
  • Version of react: latest to this date 2/18/2022
  • Browser version: Firefox (latest) to this date 2/18/2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant