Class: PhlexKit::ComboboxClearButton
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::ComboboxClearButton
- Defined in:
- app/components/phlex_kit/combobox/combobox_clear_button.rb
Overview
× button clearing the whole combobox selection — hidden until something is checked. Ported from ruby_ui's RubyUI::ComboboxClearButton; upstream referenced a clearAll action its controller never defined, so the behaviour is PhlexKit's completion of it. See combobox.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ ComboboxClearButton
constructor
A new instance of ComboboxClearButton.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ ComboboxClearButton
Returns a new instance of ComboboxClearButton.
7 8 9 |
# File 'app/components/phlex_kit/combobox/combobox_clear_button.rb', line 7 def initialize(**attrs) @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/components/phlex_kit/combobox/combobox_clear_button.rb', line 11 def view_template (**mix({ type: :button, class: "pk-combobox-clear-button pk-hidden", aria: { label: "Clear selection" }, data: { phlex_kit__combobox_target: "clearButton", action: "phlex-kit--combobox#clearAll" } }, @attrs)) do render Icon.new(:x, size: 24) end end |