Class: PhlexKit::ComboboxSearchInput
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::ComboboxSearchInput
- Defined in:
- app/components/phlex_kit/combobox/combobox_search_input.rb
Overview
Filter input at the top of a PhlexKit::ComboboxPopover (magnifier icon + borderless search field). Filtering happens client-side against each item's text (or data-text). See combobox.rb.
Instance Method Summary collapse
-
#initialize(placeholder:, **attrs) ⇒ ComboboxSearchInput
constructor
A new instance of ComboboxSearchInput.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(placeholder:, **attrs) ⇒ ComboboxSearchInput
Returns a new instance of ComboboxSearchInput.
6 7 8 9 |
# File 'app/components/phlex_kit/combobox/combobox_search_input.rb', line 6 def initialize(placeholder:, **attrs) @placeholder = placeholder @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/components/phlex_kit/combobox/combobox_search_input.rb', line 11 def view_template div(class: "pk-combobox-search") do icon input(**mix({ type: :search, role: "searchbox", autocorrect: "off", autocomplete: "off", spellcheck: "false", placeholder: @placeholder, class: "pk-combobox-search-input", data: { phlex_kit__combobox_target: "searchInput", action: "keyup->phlex-kit--combobox#filterItems search->phlex-kit--combobox#filterItems" } }, @attrs)) end end |