mirror of
https://github.com/imgurbot12/rmenu.git
synced 2024-11-10 11:33:48 +01:00
feat: ensure automatic focus
This commit is contained in:
parent
6b852bc2f4
commit
610d702c47
@ -153,6 +153,9 @@ fn matches(bind: &Vec<Keybind>, mods: &Modifiers, key: &Code) -> bool {
|
||||
fn App<'a>(cx: Scope<App>) -> Element {
|
||||
let mut state = AppState::new(cx, cx.props);
|
||||
|
||||
// always ensure focus
|
||||
focus(cx);
|
||||
|
||||
// log current position
|
||||
let search = state.search();
|
||||
let (pos, subpos) = state.position();
|
||||
@ -206,7 +209,7 @@ fn App<'a>(cx: Scope<App>) -> Element {
|
||||
cx.render(rsx! {
|
||||
style { "{cx.props.css}" }
|
||||
div {
|
||||
onclick: |_| focus(cx),
|
||||
// onclick: |_| focus(cx),
|
||||
onkeydown: keyboard_controls,
|
||||
div {
|
||||
class: "navbar",
|
||||
|
Loading…
Reference in New Issue
Block a user