Class: PhlexKit::ComboboxList
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::ComboboxList
- Defined in:
- app/components/phlex_kit/combobox/combobox_list.rb
Overview
Scrollable option list in a PhlexKit::ComboboxPopover. Carries the listbox role and an id the controller points the combobox element's aria-controls at (and derives option ids from). See combobox.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ ComboboxList
constructor
A new instance of ComboboxList.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ ComboboxList
Returns a new instance of ComboboxList.
6 7 8 |
# File 'app/components/phlex_kit/combobox/combobox_list.rb', line 6 def initialize(**attrs) @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/components/phlex_kit/combobox/combobox_list.rb', line 10 def view_template(&) div(**mix({ id: "pk-combobox-list-#{SecureRandom.hex(4)}", class: "pk-combobox-list", role: "listbox", data: { phlex_kit__combobox_target: "list" } }, @attrs), &) end |