Class: Cmdk::Input

Inherits:
Base
  • Object
show all
Defined in:
lib/cmdk/input.rb

Overview

Command menu search input. Port of ‘<Command.Input>` from cmdk. `id`, `aria-controls`, `aria-labelledby` and `aria-activedescendant` are wired up by the JS runtime at init.

Constant Summary

Constants inherited from Base

Base::SR_ONLY_STYLE

Instance Method Summary collapse

Constructor Details

#initialize(value: nil, enterkeyhint: 'go', **attributes) ⇒ Input

‘enterkeyhint:` labels the mobile keyboard’s action key (pass nil to omit).



7
8
9
10
11
# File 'lib/cmdk/input.rb', line 7

def initialize(value: nil, enterkeyhint: 'go', **attributes)
  @value = value
  @enterkeyhint = enterkeyhint
  @attributes = attributes
end

Instance Method Details

#view_templateObject



13
14
15
# File 'lib/cmdk/input.rb', line 13

def view_template
  input(**merged(input_attributes, @attributes))
end