rpt14-codeblooded / photo-gallery-service

MIT License
0 stars 1 forks source link

Fix bug where carousel resets to 0 index on click #40

Closed manuelreneduran closed 5 years ago

manuelreneduran commented 5 years ago

Epic bug. The slider onClick would trigger a re-render of the carousel which would reset the carousel's position back to the default 0 index. Fixed it by adding an index to each image, saving that index to state and then passing that index as a value to the carousel's "currentSlide" property. Had to use a little modulo magic to slide higher than 6. Fixed!