Topic: MDBCarousel dynamic slide property not working

famu1hundred free asked 5 years ago


Using a property to play/pause the slide effect on MDBCarousel does not work

//Parent component
this.state = { playSlide: false };

togglePlay = () => {
    this.setState({playSlide: !this.state.playSlide});
}
...render
<MDBSwitch checked={playSlides} onChange={this.togglePlaySlides} labelLeft="Play"/>
<TileCarousel slide={playSlide} />

//TileCarousel component
...render
const { slide } = this.props; //from Parent component
<MDBCarousel activeItem={1} length={3} slide={slide} showControls={false} showIndicators={true} multiItem interval={10000}>
...
</MDBCarousel>

Initially Carousel is fine. If I toggle the switch to true, property is being sent to child (TileCarousel) component but carousel does not slide. Shouldn't this work?


Konrad Stępień staff answered 5 years ago


Hi @famu1hundred,

Thank you for response!

I checked the issue and this is a bug. Carousel needs a little update to fix this problem. We will deal with this.

Best, Konrad.


famu1hundred free commented 5 years ago

Has this been fixed yet?


Konrad Stępień staff commented 5 years ago

Hi @famu1hundred,

I did fix this bug, but can you check this bug still exists?

Please update MDBreact to the latest version.

Best regards, Konrad.


famu1hundred free commented 5 years ago

I have version 4.18. I tried deleting the node_modules folder and running npm install and this is the version that downloaded, and the bug still exists. Is there a more recent version?


Konrad Stępień staff commented 5 years ago

Hi @famu1hundred,

We have to fix it again. Can you wait for the next release (30 September)?

Best regards, Konrad.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.16.0
  • Device: Macbook Pro
  • Browser: Chrome
  • OS: MacOS Mojave
  • Provided sample code: No
  • Provided link: No