React-responsive-carousel: Manual links changing position to 0

Created on 29 Mar 2016  路  3Comments  路  Source: leandrowd/react-responsive-carousel

When I add some links(to open a modal window) in the carousel, clicking those links are changing the position of carousel to 0(first one). How can I prevent this?

<a href="#" onClick={this.openModal.bind(this)}>link</a>

question

Most helpful comment

Hi again, I tried all, didn't work. But I realised when I update the state in my method, normally the Carousel was resetting. So now, I am trying to fix the problem by passing 'selectedItem' prop. Soon I will let you know if this will help me. Thank you so much!

All 3 comments

Hi @sercaninaler, you can pass a handler to onClickItem in the Carousel tag or call e.preventDefault() inside your openModal method. Please let me know how it goes.

Hi again, I tried all, didn't work. But I realised when I update the state in my method, normally the Carousel was resetting. So now, I am trying to fix the problem by passing 'selectedItem' prop. Soon I will let you know if this will help me. Thank you so much!

selectedItem prop helped me to position the slider as i wanted. Thank you so much for great module!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sprlwrksAprilmintacpineda picture sprlwrksAprilmintacpineda  路  6Comments

daniel7777cohen picture daniel7777cohen  路  5Comments

kartikeyb picture kartikeyb  路  5Comments

ledbetterljoshua picture ledbetterljoshua  路  6Comments

anhkhoi picture anhkhoi  路  6Comments