Skip to content

Carousel: Carousel.navigateTo() doesn't reset _resizing flag, causing first programmatic navigation to have no animation #13625

@shubho5

Description

@shubho5

Describe the bug

The navigateTo() method in the Carousel component does not reset the internal _resizing flag before performing navigation. This causes the suppressAnimation getter to return true, which adds the ui5-carousel-content-no-animation CSS class and disables the slide transition.

This issue is particularly noticeable when arrowsPlacement is set to CarouselArrowsPlacement.Navigation, where the ResizeObserver triggers during initial mount and sets _resizing = true. The first programmatic call to navigateTo() then executes with animations suppressed.

Isolated Example

No response

Reproduction steps

  1. Create a Carousel with arrowsPlacement={CarouselArrowsPlacement.Navigation}
  2. Add multiple items to the carousel
  3. Call carouselRef.current?.navigateTo(1) programmatically on first user interaction (e.g., button click)
  4. Observe: First navigation has no animation (instant snap)
  5. Call navigateTo(2) again
  6. Observe: Subsequent navigations animate correctly

Expected Behaviour

Programmatic navigation via navigateTo() should animate smoothly on every call, including the first navigation after component mount.

Screenshots or Videos

No response

UI5 Web Components for React Version

Carousel

UI5 Web Components Version

"@ui5/webcomponents": "2.18.1", "@ui5/webcomponents-fiori": "2.18.1", "@ui5/webcomponents-react": "2.18.1", "@ui5/webcomponents-react-compat": "2.18.1",

Browser

Chrome

Operating System

No response

Additional Context

No response

Relevant log output

Organization

No response

Declaration

  • I’m not disclosing any internal or sensitive information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    Status
    New Issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions