fix(web): search bar is now a form: enter to submit
This commit is contained in:
parent
8ef6dca52b
commit
6bb9ee9570
1 changed files with 14 additions and 12 deletions
|
@ -8,18 +8,20 @@ pub fn Navigator() -> impl IntoView {
|
||||||
let auth = use_context::<Auth>().expect("missing auth context");
|
let auth = use_context::<Auth>().expect("missing auth context");
|
||||||
let (query, set_query) = create_signal("".to_string());
|
let (query, set_query) = create_signal("".to_string());
|
||||||
view! {
|
view! {
|
||||||
<table class="align">
|
<form action={move|| format!("/web/search?q={}", query.get())}>
|
||||||
<tr>
|
<table class="align">
|
||||||
<td class="w-100">
|
<tr>
|
||||||
<input type="text" class="w-100" on:input=move |ev| {
|
<td class="w-100">
|
||||||
set_query.set(event_target_value(&ev))
|
<input type="text" class="w-100" on:input=move |ev| {
|
||||||
} />
|
set_query.set(event_target_value(&ev))
|
||||||
</td>
|
} />
|
||||||
<td>
|
</td>
|
||||||
<a href={move|| format!("/web/search?q={}", query.get())}><input type="submit" value="go" /></a>
|
<td>
|
||||||
</td>
|
<a href={move|| format!("/web/search?q={}", query.get())}><input type="submit" value="go" /></a>
|
||||||
</tr>
|
</td>
|
||||||
</table>
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
<table class="align w-100">
|
<table class="align w-100">
|
||||||
<tr><td colspan="2"><a href="/web/home"><input class="w-100" type="submit" class:hidden=move || !auth.present() value="home timeline" /></a></td></tr>
|
<tr><td colspan="2"><a href="/web/home"><input class="w-100" type="submit" class:hidden=move || !auth.present() value="home timeline" /></a></td></tr>
|
||||||
<tr><td colspan="2"><a href="/web/server"><input class="w-100" type="submit" value="server timeline" /></a></td></tr>
|
<tr><td colspan="2"><a href="/web/server"><input class="w-100" type="submit" value="server timeline" /></a></td></tr>
|
||||||
|
|
Loading…
Reference in a new issue