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

[graphiql] Editor contents not updated when switching tabs #3095

Closed
1 of 4 tasks
bakjos opened this issue Mar 9, 2023 · 1 comment · Fixed by #3194
Closed
1 of 4 tasks

[graphiql] Editor contents not updated when switching tabs #3095

bakjos opened this issue Mar 9, 2023 · 1 comment · Fixed by #3194

Comments

@bakjos
Copy link

bakjos commented Mar 9, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When multiple tabs are open when switching from different tabs, the contents are lost

After debugging the method setState inside changeTab is called twice

this is the code used to render the graphiql component

<GraphiQL
  fetcher={graphQLFetcher}
  query={query}
  onEditQuery={setQuery}
  storage={localStorage}
  plugins={[explorerPlugin]}
  shouldPersistHeaders={true}
/>

Expected Behavior

The tabs should keep the contents

Steps To Reproduce

Screen Recording 2023-03-09 at 11 23 54 AM

No response

Module pattern

  • graphiql-umd
  • graphiql-esm
  • graphiql-commonjs

Environment

- GraphiQL Version: 2.4.0
- OS: MaxOS 13.2.1
- Browser: Chrome 110
- Bundler: Webpack(reac-scripits)
- `react` Version: 18.2.0
- `graphql` Version: 16.3.0

Anything else?

No response

@gr-myles
Copy link

+1 I am experiencing issues with tabs as well. Anytime I switch between tabs it either copies over or erases the current state to the other tab. It makes using tabs completely broken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants