akiran / react-slick

React carousel component
http://react-slick.neostack.com/
MIT License
11.61k stars 2.09k forks source link

Need callback for keyboard navigation. #2317

Open joyson-madtha0 opened 6 months ago

joyson-madtha0 commented 6 months ago

Feature

Need callback for keyboard navigation.

I was using external index buttons to switch between each slick-items using slickGoTo() on hover of the buttons. Corresponding button get's highlighted. But on keyboard navigation I never used to get any kind of onKeyboardNav(index) notification. I tried using afterChange() but it will include all changes. Also afterChange() will be triggered only after the animation. So smooth animation of the button highlight is not possible.

https://codesandbox.io/p/sandbox/react-slick-playground-forked-5f49h3