feat: pressing enter automatically navigates to the system page
This commit is contained in:
parent
327d2b8aa5
commit
f5f15a5335
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Container, Row, Col, Card, CardHeader, CardTitle, CardBody, Input, Button } from 'sveltestrap';
|
import { Container, Row, Col, Card, CardHeader, CardTitle, CardBody, Input, Button } from 'sveltestrap';
|
||||||
import { Link } from 'svelte-navigator';
|
import { Link, navigate } from 'svelte-navigator';
|
||||||
import FaRocket from 'svelte-icons/fa/FaRocket.svelte';
|
import FaRocket from 'svelte-icons/fa/FaRocket.svelte';
|
||||||
|
|
||||||
let sysInput: string = "";
|
let sysInput: string = "";
|
||||||
@ -21,7 +21,7 @@
|
|||||||
Submit a <b>system ID</b> to view that system's profile.
|
Submit a <b>system ID</b> to view that system's profile.
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={12} lg={9} class="my-2">
|
<Col xs={12} lg={9} class="my-2">
|
||||||
<Input bind:value={sysInput} />
|
<Input on:keyup={(event) => {if (event.key === "Enter" && sysInput !== "") navigate(`/public/s/${sysInput.toLowerCase().trim()}`)}} bind:value={sysInput} />
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={12} lg={3} class="my-2 d-flex">
|
<Col xs={12} lg={3} class="my-2 d-flex">
|
||||||
{#if sysInput !== ""}
|
{#if sysInput !== ""}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user