Fix autocomplete and modal backdrop

This commit is contained in:
Bojan Mojsilovic 2023-10-12 14:52:57 +02:00
parent f05149cf53
commit bba3e08ce8
4 changed files with 17 additions and 6 deletions

View File

@ -76,7 +76,7 @@ const EnterPinModal: Component<{
createEffect(() => { createEffect(() => {
if (props.open) { if (props.open) {
pinInput?.focus(); setTimeout(() => pinInput?.focus(), 200);
} }
}); });
@ -86,7 +86,7 @@ const EnterPinModal: Component<{
return ( return (
<Modal open={props.open}> <Modal open={props.open} opaqueBackdrop={true}>
<div id={props.id} class={styles.modal}> <div id={props.id} class={styles.modal}>
<button class={styles.xClose} onClick={props.onAbort}> <button class={styles.xClose} onClick={props.onAbort}>
<div class={styles.iconClose}></div> <div class={styles.iconClose}></div>
@ -110,7 +110,7 @@ const EnterPinModal: Component<{
onClick={onConfirm} onClick={onConfirm}
disabled={!isValidPin()} disabled={!isValidPin()}
> >
{intl.formatMessage(tActions.createPin)} {intl.formatMessage(tActions.login)}
</ButtonPrimary> </ButtonPrimary>
</div> </div>
</div> </div>

View File

@ -1,8 +1,12 @@
.modal { .modal {
background-color: var(--background-modal); background-color: var(--background-modal);
width: 100vw; width: 100vw;
height:100vh; height: 100vh;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
&.opaque {
background-color: var(--background-site);
}
} }

View File

@ -4,12 +4,17 @@ import { hookForDev } from '../../lib/devTools';
import styles from './Modal.module.scss'; import styles from './Modal.module.scss';
const Modal: Component<{ children: JSXElement, open?: boolean, id?: string}> = (props) => { const Modal: Component<{
children: JSXElement,
open?: boolean,
id?: string,
opaqueBackdrop?: boolean,
}> = (props) => {
return ( return (
<Show when={props.open}> <Show when={props.open}>
<Portal mount={document.getElementById("modal") as Node}> <Portal mount={document.getElementById("modal") as Node}>
<div id={props.id} class={styles.modal}> <div id={props.id} class={`${styles.modal} ${props.opaqueBackdrop ? styles.opaque : ''}`}>
{props.children} {props.children}
</div> </div>
</Portal> </Portal>

View File

@ -14,6 +14,7 @@ const TextInput: Component<{
ref?: HTMLInputElement, ref?: HTMLInputElement,
validationState?: 'valid' | 'invalid', validationState?: 'valid' | 'invalid',
type?: string, type?: string,
autocomplete?: string,
}> = (props) => { }> = (props) => {
return ( return (
@ -36,6 +37,7 @@ const TextInput: Component<{
class={styles.input} class={styles.input}
readOnly={props.readonly} readOnly={props.readonly}
type={props.type} type={props.type}
autocomplete={props.autocomplete || "off"}
/> />
<div class={styles.inputAfter}> <div class={styles.inputAfter}>