diff --git a/keybind-cheatsheet/panel.luau b/keybind-cheatsheet/panel.luau index a566018a..c947d9ed 100644 --- a/keybind-cheatsheet/panel.luau +++ b/keybind-cheatsheet/panel.luau @@ -776,7 +776,10 @@ local function renderHeader() searchRevision += 1 render() end) - table.insert(children, ui.input({ key = "search-" .. searchRevision, value = query, placeholder = tr("search_placeholder"), controlSize = "sm", width = 300, onChange = searchChanged })) + -- The panel is opened to look something up, so typing goes straight to the + -- search box without clicking it first. Dropped while a description is + -- being edited, so that row's own input keeps the caret. + table.insert(children, ui.input({ key = "search-" .. searchRevision, value = query, placeholder = tr("search_placeholder"), controlSize = "sm", width = 300, onChange = searchChanged, focus = editingId == nil })) table.insert(children, ui.button({ glyph = "x", width = 26, variant = "ghost", controlSize = "sm", enabled = query ~= "", tooltip = tr("clear"), onClick = clearSearch })) end if not loading or #bindings > 0 then diff --git a/keybind-cheatsheet/plugin.toml b/keybind-cheatsheet/plugin.toml index 11e35dd1..0a92f814 100644 --- a/keybind-cheatsheet/plugin.toml +++ b/keybind-cheatsheet/plugin.toml @@ -1,6 +1,6 @@ id = "kenn/keybind-cheatsheet" name = "Keybind Cheatsheet" -version = "0.2.4" +version = "0.2.5" plugin_api = 9 author = "kenn" license = "MIT"