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

View jumping around on enter keypress / mouseclick #124

Closed
elipp opened this issue Aug 16, 2022 · 5 comments
Closed

View jumping around on enter keypress / mouseclick #124

elipp opened this issue Aug 16, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@elipp
Copy link

elipp commented Aug 16, 2022

Hey, anyone else have this issue where the view resets back to the top whenever a value is appended to an object / array using the enter key? Same seems to apply to clicking on nested objects, like nested arrays of objects etc. Anything I might be missing here?

Using the vanilla version / v0.6.2 / f61f9a1

@josdejong
Copy link
Owner

Thanks for reporting. How can I reproduce your issue? Can you create a minimal https://codesandbox.io demonstrating the issue?

It sounds like you're recreating the editor with every render or something like that.

Possibly related: #23

@josdejong josdejong added the question Further information is requested label Aug 16, 2022
@elipp
Copy link
Author

elipp commented Aug 17, 2022

Seems like giving the targeted div element a fixed height resolves this issue, will confirm later :D

@Gregory-Ledray
Copy link

Gregory-Ledray commented Aug 17, 2022

Reproduction for me in Chrome: https://codesandbox.io/s/frosty-surf-47qqdr?file=/src/components/HelloWorld.vue

Clicking on "abc" moves me to the top of the window. Double clicking lets me edit, but only if I double click very quickly.

[Edit] I added a second div and second vanilla-json with a fixed height to the targeted div element by adding a 'style' attribute but it did not fix the problem.

@Gregory-Ledray
Copy link

With a fixed height, the tree editor does not seem to scroll to the top of the screen. In fact, the editor's focus seems to stay at the correct place - I can tab around and still edit values, and the editor's scroll bar does not seem to move. However, the hosting page also has a scroll bar, and when I edit with a fixed height it is that scroll bar which moves.

I've set the height of the editor to 75vh as a workaround, although it is still jarring when I scroll a little bit too far and then edit a value and the screen jumps back up again.

@josdejong
Copy link
Owner

Ah, thanks, I can reproduce this issue, thanks for working it out and pinpointing that it has to do with the editor not having a fixed height, hence not having scrolling contents itself.

@josdejong josdejong added bug Something isn't working and removed question Further information is requested labels Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants