37fd2b248d
- Make them navigable by keyboard (UP, DOWN, ENTER to activate option). - Filter based on the actual text in the element, use containment condition instead of CSS selector on value prefix. - Make all the elements in the filter searchable and reachable by keyboard.
25 lines
1.2 KiB
Plaintext
25 lines
1.2 KiB
Plaintext
<%= form_tag commands_path,
|
|
id: "commands_form",
|
|
class: [ "flex align-center gap-half" ],
|
|
data: {
|
|
controller: "form",
|
|
terminal_target: "form",
|
|
action: "turbo:submit-start->terminal#commandSubmitted turbo:submit-end->terminal#focus keydown.meta+k@document->terminal#focus:prevent keydown.ctrl+k@document->terminal#focus:prevent keydown.enter->terminal#executeCommand keydown.esc->terminal#hideMenus turbo:submit-end->terminal#handleCommandResponse"
|
|
} do %>
|
|
<label class="terminal__label txt-nowrap" for="fizzy_do">Fizzy do ></label>
|
|
|
|
<%= text_field_tag "command", nil,
|
|
autocomplete: "off",
|
|
autocorrect: "off",
|
|
autocapitalize: "off",
|
|
class: "terminal__input input fill-transparent unpad",
|
|
data: {
|
|
terminal_target: "input",
|
|
action: "keydown.up->toggle-class#add:prevent keydown.up->navigable-list#selectCurrentOrReset:stop terminal#hideError"
|
|
},
|
|
placeholder: "Press #{ hotkey_label(["ctrl", "K"]) } to search or type commands…",
|
|
spellcheck: "false" %>
|
|
|
|
<%= hidden_field_tag "confirmed", nil, data: { terminal_target: "confirmation" } %>
|
|
<% end %>
|