question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Keyboard navigation is out-of-sync from viewstate

See original GitHub issue

Describe the bug A clear and concise description of what the bug is.

when opening a folder in the tree using the right-arrow, and then move down, the focus is on the item after the tree item, IF the ‘items’ of the tree are the same. when the items change as well (for instance items keeping track of expand state as well) then it works fine.

To Reproduce Steps to reproduce the behavior:

  1. visit: https://rct.lukasbach.com/docs/guides/controlled-environment/#managing-the-view-state-of-the-tree
  2. Click ‘Desserts’ (it should expand immediately)
  3. Press arrow down (focus becomes “Drinks”)

Expected behavior A clear and concise description of what you expected to happen.

  1. visit: https://rct.lukasbach.com/docs/guides/controlled-environment/#managing-the-view-state-of-the-tree
  2. Click ‘Desserts’ (it should expand immediately)
  3. Press arrow down (focus should become “Cookies”)

Screenshots If applicable, add screenshots to help explain your problem.

keyboard-bug

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: 102

Additional context Add any other context about the problem here.

I could fix this behaviour in my own application by updating the object reference of items whenever the expanded view state changed. I suspect there the keyboard navigation is somehow using an out of date ‘linear list’ because it only updates when the ‘items’ change, and not when the ‘expandedItems’ state changes.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
matthijsgroencommented, May 27, 2022

It works perfectly now! Thank you! (will update the online build later)

1reaction
lukasbachcommented, May 27, 2022

Thanks, that really was helpful in debugging, I believe I found the issue now. Please try again with RCT version 1.1.8, I hope this time there are no other problems 😅 Let me know if you have any other issues, and btw your project looks awesome! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

PM Internal selection looks "out of sync" under certain condition
We want the user be able to interract with the text-editor by using the keyboard. With keyboard shortcuts of course, but also by...
Read more >
Map flickers on transition when viewState is stored in Redux
When putting my viewState in Redux - and starting any kind of transition, ... they will go out of sync with the map...
Read more >
Keyboard out of sync
1. Run Keyboard Troubleshooter Type Troubleshoot in Windows Start Search box > Click Troubleshoot > Scroll down and click Keyboard > Run the ......
Read more >
How to detect page refresh in .net
On post the session and viewstate IsPageRefresh values will be equal, but they become out of sync on a page refresh.
Read more >
#31846 (Using the browser's Back and Forward buttons ...
Next/previous navigation happens also when using the keyboard Arrow right/left keys. ... Set view state properly when navigating history using the browser ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found