Skip to content

fix[widgets][carousel]: ENG-12409 prevent dom-prop warnings and hide the empty arrows#4550

Open
floating-dynamo wants to merge 4 commits into
mainfrom
ENG-12409-fix-carousel
Open

fix[widgets][carousel]: ENG-12409 prevent dom-prop warnings and hide the empty arrows#4550
floating-dynamo wants to merge 4 commits into
mainfrom
ENG-12409-fix-carousel

Conversation

@floating-dynamo

@floating-dynamo floating-dynamo commented May 5, 2026

Copy link
Copy Markdown
Contributor

Description

  • The arrow buttons were plain divs passed to react-slick. Slick clones them and adds currentSlide / slideCount props, which React was complaining about that they aren't valid DOM attributes.
  • So I have now wrapped the arrows in a small CarouselArrow component that filters those out before spreading the rest onto the div.
  • Also fixed another issue, wherein setting empty content on the arrows didn't actually hide them, because slick still draws a 20x20 absolute-positioned click target.
  • Now we set arrows: false on slick when both prevButton and nextButton are empty. Anyone passing slickProps.arrows explicitly will still get the value.

Screenshot

Before

Warnings related to props
image

image

After

No warnings
image

The carousel doesn't leave invisible click areas at the edges
image


Note

Low Risk
Localized carousel UI fix with no auth, data, or API impact; only affects arrow rendering and slick configuration defaults.

Overview
Fixes react-slick carousel arrow behavior in Carousel.tsx by wrapping custom prev/next controls in a CarouselArrow helper that strips currentSlide and slideCount before they reach the DOM, eliminating React invalid-attribute warnings when slick clones the arrow elements.

Also sets arrows on the slider to false when both prevButton and nextButton have no blocks, so slick no longer renders the default 20×20 invisible edge click targets when arrows are intentionally empty. An explicit slickProps.arrows can still override because slickProps is spread after this default.

Reviewed by Cursor Bugbot for commit d7f4f41. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented May 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d7f4f41

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud

nx-cloud Bot commented May 5, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit d7f4f41

Command Status Duration Result
nx test @snippet/react ✅ Succeeded 1m 9s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-06-23 04:46:42 UTC

@midhunadarvin

Copy link
Copy Markdown
Contributor
  • add changset before merging

@AishwaryaParab AishwaryaParab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AishwaryaParab

Copy link
Copy Markdown
Contributor

@floating-dynamo question: which sdks will this affect? both gen1 and gen2?

@floating-dynamo

Copy link
Copy Markdown
Contributor Author

@floating-dynamo question: which sdks will this affect? both gen1 and gen2?

This change is related to the widgets package.

@floating-dynamo

Copy link
Copy Markdown
Contributor Author
  • add changset before merging

I think this has a different release process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants