graphiql icon indicating copy to clipboard operation
graphiql copied to clipboard

when using onEditQuery, the explorer scroll resets to the beginning

Open nadendlaprasad opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

In the context of onEditQuery handler, every time it fires, i had to set a state which then resets the scroll to the beginning.

Expected Behavior

The scroll state should persist based on the active query or remain as is without resetting to the beginning.

Steps To Reproduce

const test = ()=>{ const [query, setQuery] = useState(""); const plugins = [explorer]; const onEditQuery = (query) => { setQuery(query); }; return (<GraphiQL plugins={plugins} onEditQuery={onEditQuery}> </GraphiQL>) }

Environment

  • GraphiQL Version: 3.0.10
  • OS: Windows/Linux
  • Browser: Chrome
  • Bundler:
  • react 18.1.0
  • graphql Version: 16.4.0

Anything else?

No response

nadendlaprasad avatar Feb 12 '24 10:02 nadendlaprasad

I have the same issue

jacobhoekert avatar Mar 18 '24 22:03 jacobhoekert