Class: FoxTail::Dropdown::MenuItemComponent

Inherits:
ClickableComponent
  • Object
show all
Defined in:
app/components/fox_tail/dropdown/menu_item_component.rb

Instance Method Summary collapse

Instance Method Details

#before_renderObject



42
43
44
45
46
47
48
# File 'app/components/fox_tail/dropdown/menu_item_component.rb', line 42

def before_render
  super

  if self.class.use_stimulus? && options.key?(:autocomplete_value)
    FoxTail::AutocompleteComponent.append_option_action autocomplete_value, autocomplete_text, html_attributes
  end
end

#callObject



50
51
52
53
54
55
56
# File 'app/components/fox_tail/dropdown/menu_item_component.rb', line 50

def call
  super do
    concat left_visual if left_visual?
    concat content
    concat right_visual if right_visual?
  end
end

#visuals?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'app/components/fox_tail/dropdown/menu_item_component.rb', line 38

def visuals?
  left_visual? || right_visual?
end