forked from mirrors/rmenu
feat: ensure automatic focus
This commit is contained in:
parent
6b852bc2f4
commit
610d702c47
1 changed files with 4 additions and 1 deletions
|
@ -153,6 +153,9 @@ fn matches(bind: &Vec<Keybind>, mods: &Modifiers, key: &Code) -> bool {
|
||||||
fn App<'a>(cx: Scope<App>) -> Element {
|
fn App<'a>(cx: Scope<App>) -> Element {
|
||||||
let mut state = AppState::new(cx, cx.props);
|
let mut state = AppState::new(cx, cx.props);
|
||||||
|
|
||||||
|
// always ensure focus
|
||||||
|
focus(cx);
|
||||||
|
|
||||||
// log current position
|
// log current position
|
||||||
let search = state.search();
|
let search = state.search();
|
||||||
let (pos, subpos) = state.position();
|
let (pos, subpos) = state.position();
|
||||||
|
@ -206,7 +209,7 @@ fn App<'a>(cx: Scope<App>) -> Element {
|
||||||
cx.render(rsx! {
|
cx.render(rsx! {
|
||||||
style { "{cx.props.css}" }
|
style { "{cx.props.css}" }
|
||||||
div {
|
div {
|
||||||
onclick: |_| focus(cx),
|
// onclick: |_| focus(cx),
|
||||||
onkeydown: keyboard_controls,
|
onkeydown: keyboard_controls,
|
||||||
div {
|
div {
|
||||||
class: "navbar",
|
class: "navbar",
|
||||||
|
|
Loading…
Add table
Reference in a new issue