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

When use the control panel to change the selected item from timeline #434

Open
szolen opened this issue Nov 3, 2023 · 2 comments · Fixed by #447
Open

When use the control panel to change the selected item from timeline #434

szolen opened this issue Nov 3, 2023 · 2 comments · Fixed by #447
Assignees

Comments

@szolen
Copy link

szolen commented Nov 3, 2023

When I use the buttons on the control panel the index of the selected item is always zero. Also, when using the slide show, the indexes are shifted by one.

To reproduce: https://codesandbox.io/s/show-all-cards-forked-kx8885

@prabhuignoto prabhuignoto self-assigned this Nov 7, 2023
@prabhuignoto prabhuignoto mentioned this issue Jan 4, 2024
8 tasks
@prabhuignoto prabhuignoto linked a pull request Jan 4, 2024 that will close this issue
8 tasks
prabhuignoto added a commit that referenced this issue Jan 7, 2024
 - Fix for #434 (onItemSelected does not work as expected)
 - Support for rendering HTML directly on the timeline cards (#443 )
 - New prop `disableRendering` to disable all interactions with the timeline (#294)
 - New prop `highlightCardsOnHover` that highlights cards on hover
@szolen szolen changed the title When use the control panel to change the selected item from timeline, When use the control panel to change the selected item from timeline Jan 17, 2024
@szolen
Copy link
Author

szolen commented Jan 17, 2024

Hi! I tried the 2.4.0 version, but unfortunately the above mentioned bug was only partially fixed.

When I use the timeline or the next navigation buttons (first, previous, next, last), the index handling works fine. However, if I use "Play Slideshow", it still returns the wrong index for onItemSelected: 1 less than it should.

Another thing I noticed about the index handling is that if I change the contents of the "items", the timeline jumps back to the first item (this is fine). If I then use the navigation buttons to move the timeline, however, it does not move to the next item (idnex 1), but instead to the current item in the previous items collection.

For example:

  • if the selected item idnex is 5 (I select the sixth item)
  • I update the items collection
  • the selected item becomes the first (index zero)
  • press the "Next" button
  • the timeline will jump to the seventh item (with index 6)

@prabhuignoto
Copy link
Owner

@szolen, thanks for reviewing this and providing a detailed observation of the issue. I've released a patch to address the problems you highlighted. 2.4.2

@prabhuignoto prabhuignoto reopened this Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants