Class: PhlexKit::ComboboxListGroup
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::ComboboxListGroup
- Defined in:
- app/components/phlex_kit/combobox/combobox_list_group.rb
Overview
Labelled option group. Pass label: — it renders as aria-label (a bare
label attribute is invalid on
and silent to AT) plus data-label,
which CSS renders via ::before content(attr(data-label)). The group
auto-hides (pure CSS :has) when filtering leaves it with no visible items.
See combobox.rb.
Instance Method Summary collapse
-
#initialize(label: nil, **attrs) ⇒ ComboboxListGroup
constructor
A new instance of ComboboxListGroup.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(label: nil, **attrs) ⇒ ComboboxListGroup
Returns a new instance of ComboboxListGroup.
8 9 10 11 |
# File 'app/components/phlex_kit/combobox/combobox_list_group.rb', line 8 def initialize(label: nil, **attrs) @label = label @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'app/components/phlex_kit/combobox/combobox_list_group.rb', line 13 def view_template(&) div(**mix({ class: "pk-combobox-group", role: "group", aria: { label: @label }, data: { label: @label } }, @attrs), &) end |