mrjvs / neatojs

Collection of neat JS tools
https://neatojs.com/
MIT License
27 stars 3 forks source link

sidebar items dont get properly rerendered when only switching directory #35

Closed mrjvs closed 6 months ago

mrjvs commented 6 months ago

Describe the bug

because directory switching only switches out items. items keep being highlighted (from focus state) after switching.

Which package/app is affected (leave empty if unsure)

@neato/guider

Link to the code that reproduces this issue

No response

Steps to reproduce

  1. make two directories in a site. give them each a few links
  2. make window small to see mobile view
  3. click on a sidebar item
  4. focus state persists because it has the same component key (index based)

Expected Behavior

focus state should be removed, caused by rerender

Extra details

this is because the component key is only the index. it should also use the to parameter and the item type. Should be fixed on every navigation list (sidebar, dropdown, topnav)