react-slick icon indicating copy to clipboard operation
react-slick copied to clipboard

Removed Items

Open maxval1 opened this issue 8 years ago • 3 comments

Hi, i have a problem when i want to delete one items Reproduce:

  1. Go to slide 2
  2. Click on the image

Live https://codesandbox.io/s/wnz6jxv267

maxval1 avatar Mar 13 '18 08:03 maxval1

hi! You can try slickGoTo method. Pass index there to go to the previous slide (or whatever you want) As well possibly you'll need to repaint (on the DOM level) your slides, try to use key prop for that. uniqueId method from Lodash would help.

import uniqueId form 'Loadash';

<Slider {...settings}>
          {this.state.items.map((el, index) => {
            return (
              <div
                style={styles}
                key={uniqueId()}
                onClick={() => {
                  this.handleDelete(index);
                }}
              >
                {el}
              </div>
            );
          })}
</Slider>

VladPoe avatar Mar 15 '18 11:03 VladPoe

@maxval94 the problems seems to be there in version 0.20.0. But when I checked with dev branch, it worked fine, that means it's already been fixed. You can try the same with the dev branch. These changes will be released soon.

laveesingh avatar Mar 19 '18 05:03 laveesingh

Thanks

maxval1 avatar Mar 19 '18 10:03 maxval1