-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring Carousel
widget.
#174
base: master
Are you sure you want to change the base?
Conversation
terabytesoftw
commented
Nov 6, 2024
Q | A |
---|---|
Is bugfix? | ❌ |
New feature? | ✔️ |
Breaks BC? | ❌ |
…t types and improve caption handling.
…dling and improve attribute management.
$activeItems = array_filter($this->items, static fn (CarouselItem $item) => $item->isActive()); | ||
|
||
if (count($activeItems) > 1) { | ||
throw new InvalidArgumentException('Only one carousel item can be active at a time.'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check could be done inside of foreach
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it too, but i need to know before iterating if any element is active, otherwise i mark the first one as active, and there may be the possibility that any element is active.