diff --git a/lib/moon/design/carousel/item.ex b/lib/moon/design/carousel/item.ex index e47aba796..58b2c3c32 100644 --- a/lib/moon/design/carousel/item.ex +++ b/lib/moon/design/carousel/item.ex @@ -22,9 +22,13 @@ defmodule Moon.Design.Carousel.Item do @doc "Will be got from Carousel in most cases" prop(is_active, :boolean, from_context: :is_active) + @doc "Conditional displaying due to an issue with named slots in Surface" + prop(is_hidden, :boolean, default: false) + def render(assigns) do ~F"""
  • - {#for {_, index} <- Enum.with_index(make_list(@item) ++ make_list(@default))} - <#slot - {@indicator} - context_put={ - on_change: @on_change, - value: to_string(index) - } - /> + {#for {item, index} <- Enum.with_index(make_list(@item))} + {#if !item.is_hidden} + <#slot + {@indicator} + context_put={ + on_change: @on_change, + value: to_string(index) + } + /> + {/if} {/for} """