graphiql: Unexpected Cursor Offset when hitting Enter
Using GitHubs’s new video upload feature, here’s the bug. When pressing enter, for some reason the cursor skips a line. The expected behavior would be for the cursor to go to the next line and with a few spaces similar to when it’s Prettified
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 27 (12 by maintainers)
I also experienced this issue. Following @halvespereira 's instructions where I removed
graphiqlentirely, installedgraphiql@1.3.0(which works), and then upgraded tographiql@1.3.2which still fixed it.I definitely suspect some sort of dependency issue is at play.
@acao have you done anything to the code? It suddenly works in development and in production. At least it does now.
Something interesting just happened to @etiennedi
rm -rf node_modules && npm install- issue still goneHowever, when I tried to reproduce this, the issue was still there for me in all versions.
@acao The cursor offset bug is happening again in the development environment. It’s strange because I didn’t touch that code from the time it was working properly to now.
I did update a few dependencies but not the
graphiql. We will keep you updated. Please keep us updated as well if you are able to detect what’s potentially causing it. Thanks.Thanks so much for the help so far @acao!
To add to what our production config is:
buildfolder into annginxdocker image (the contents of thebuildfolder is the same that works withnpx serve ./build)We will also go through our build process step-by-step to see if we can identify anything that breaks it (e.g. running from a Docker container, serving the app through
nginx, etc.) - but it will probably take a few days to get back on this.It’s gone. Thanks for the comments. They helped me think a little better of the issue. I have this additional toolbar button which copies the query to clipboard so I can share a link that directs the user straight into the graphiql page with the query already typed and prettified.
I had a
refwrapped around the additional toolbar button which I was using for toggling the component state. Anyway, once I removed the ref, the bug was gone and I found a work around for not using the ref anymore. Don’t know why it was causing it though.No it was the other way around. When I first installed graphiql the bug wasn’t there. Then after a few weeks it showed up and it’s there consistently day in day out.
No shortcuts or anything. Just pressing enter. It only happens if
Enteris pressed after{,(etc. But if the cursor is at the beginning of the line with nothing typed, then it goes to the next line as expected without skipping a line.Sure.
graphiql: ^1.3.2on a React app. What’s interesting is that at first it was working as intended but then it started happening. I do need to mention that I’ve uninstall it and reinstalled it again with different version so maybe that caused it. But now I have 1.3.2 installed.Version 88.0.4324.96 (Official Build) (64-bit)