Allow enter key to continue (#12762)
This commit is contained in:
parent
1f958fcf53
commit
aa579699b5
|
@ -40,7 +40,7 @@
|
||||||
loading = false
|
loading = false
|
||||||
}
|
}
|
||||||
|
|
||||||
async function confirm() {
|
export async function confirm() {
|
||||||
loading = true
|
loading = true
|
||||||
if (!onConfirm || (await onConfirm()) !== keepOpen) {
|
if (!onConfirm || (await onConfirm()) !== keepOpen) {
|
||||||
hide()
|
hide()
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
const appPrefix = "/app"
|
const appPrefix = "/app"
|
||||||
let touched = false
|
let touched = false
|
||||||
let error
|
let error
|
||||||
|
let modal
|
||||||
|
|
||||||
$: appUrl = screenUrl
|
$: appUrl = screenUrl
|
||||||
? `${window.location.origin}${appPrefix}${screenUrl}`
|
? `${window.location.origin}${appPrefix}${screenUrl}`
|
||||||
|
@ -50,6 +51,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ModalContent
|
<ModalContent
|
||||||
|
bind:this={modal}
|
||||||
size="M"
|
size="M"
|
||||||
title={"Screen details"}
|
title={"Screen details"}
|
||||||
{confirmText}
|
{confirmText}
|
||||||
|
@ -58,15 +60,17 @@
|
||||||
cancelText={"Back"}
|
cancelText={"Back"}
|
||||||
disabled={!screenUrl || error || !touched}
|
disabled={!screenUrl || error || !touched}
|
||||||
>
|
>
|
||||||
<Input
|
<form on:submit|preventDefault={() => modal.confirm()}>
|
||||||
label="Enter a URL for the new screen"
|
<Input
|
||||||
{error}
|
label="Enter a URL for the new screen"
|
||||||
bind:value={screenUrl}
|
{error}
|
||||||
on:change={routeChanged}
|
bind:value={screenUrl}
|
||||||
/>
|
on:change={routeChanged}
|
||||||
<div class="app-server" title={appUrl}>
|
/>
|
||||||
{appUrl}
|
<div class="app-server" title={appUrl}>
|
||||||
</div>
|
{appUrl}
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
Loading…
Reference in New Issue