Class: PhlexKit::ComboboxPopover
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::ComboboxPopover
- Defined in:
- app/components/phlex_kit/combobox/combobox_popover.rb
Overview
The combobox dropdown panel. Upstream uses the native Popover API + @floating-ui; here it's a CSS-positioned panel toggled with .pk-hidden (the keyboard nav actions ride on it, since focus sits in the search input inside). See combobox.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ ComboboxPopover
constructor
A new instance of ComboboxPopover.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ ComboboxPopover
Returns a new instance of ComboboxPopover.
7 8 9 |
# File 'app/components/phlex_kit/combobox/combobox_popover.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 24 25 |
# File 'app/components/phlex_kit/combobox/combobox_popover.rb', line 11 def view_template(&) div(**mix({ class: "pk-combobox-popover pk-hidden", data: { phlex_kit__combobox_target: "popover", action: [ "keydown.down->phlex-kit--combobox#keyDownPressed", "keydown.up->phlex-kit--combobox#keyUpPressed", "keydown.enter->phlex-kit--combobox#keyEnterPressed", "keydown.esc->phlex-kit--combobox#closePopover:prevent", "resize@window->phlex-kit--combobox#updatePopoverWidth" ].join(" ") } }, @attrs), &) end |