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

Warnings on draggable=false

Open weignerg opened this issue 6 years ago • 9 comments

https://github.com/brainhubeu/react-carousel/blob/bf8f7e76e9e0cac73e69c685a0df1e2483dbdb5f/src/components/CarouselItem.js#L46

image

False is being passed rather than the function when draggable is set to false.

Would this code work?

{ this.props.isDraggingEnabled && ...( onMouseDown={this.onMouseDown} onTouchStart={this.onTouchStart} ) }

weignerg avatar Apr 13 '20 19:04 weignerg

Conditionally add the prop of a function rather than add a prop conditionally false or function.

weignerg avatar Apr 13 '20 20:04 weignerg

@weignerg

Thanks for reporting this but I'm not able to reproduce this issue. Screenshot 2020-04-13 at 22 42 10

Could you provide an example code possible to paste into the demo/ docs and what's needed to perform In order to see these warnings?

Regarding improvements, the simplest will be if you open a PR.

piotr-s-brainhub avatar Apr 13 '20 20:04 piotr-s-brainhub

These are warning that show up in development build. Production build does not show the warnings.

I am not yet familiar with how to go about making the change, testing it and submitting the pull request.

weignerg avatar Apr 13 '20 23:04 weignerg

To reproduce, start a development application and navigate to a page with a carousel that has the draggable prop set to false.

weignerg avatar Apr 13 '20 23:04 weignerg

@weignerg

Neither locally I can reproduce that. I set draggable to false and I click the image and I see no warnings. Screenshot 2020-04-14 at 01 37 46 The only warnings are generated after the page reload.

piotr-s-brainhub avatar Apr 13 '20 23:04 piotr-s-brainhub

I am using it in a typescript file.

Here is the version being used. "dependencies": { "@brainhubeu/react-carousel": "^1.13.19", "@types/brainhubeu__react-carousel": "^1.10.2",

weignerg avatar Apr 14 '20 16:04 weignerg

@weignerg

I don't think TS matters here as TS throws errors at the compilation time and here is an error in the runtime.

piotr-s-brainhub avatar Apr 14 '20 16:04 piotr-s-brainhub

This looks like a duplicate of this issue.

https://github.com/brainhubeu/react-carousel/issues/407

What was upgraded to .24 to fix it?

weignerg avatar Apr 14 '20 16:04 weignerg

Issue not present in later version.

I upgraded to newest version of the react carousel.

npm i @brainhubeu/react-carousel "@brainhubeu/react-carousel": "^1.13.32",

npm i @types/brainhubeu__react-carousel -D "@types/brainhubeu__react-carousel": "^1.13.0",

weignerg avatar Apr 14 '20 17:04 weignerg