mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 12:24:38 +03:00
for username/email input field in login form, automatically resize so also longer addresses are fully visible
feedback from jsfan3 in issue #58, thanks!
This commit is contained in:
@ -236,6 +236,7 @@ const login = async (reason: string) => {
|
||||
const origFocus = document.activeElement
|
||||
let reasonElem: HTMLElement
|
||||
let fieldset: HTMLFieldSetElement
|
||||
let autosize: HTMLElement
|
||||
let username: HTMLInputElement
|
||||
let password: HTMLInputElement
|
||||
const root = dom.div(
|
||||
@ -277,7 +278,14 @@ const login = async (reason: string) => {
|
||||
dom.label(
|
||||
style({display: 'block', marginBottom: '2ex'}),
|
||||
dom.div('Email address', style({marginBottom: '.5ex'})),
|
||||
username=dom.input(attr.required(''), attr.placeholder('jane@example.org')),
|
||||
autosize=dom.span(dom._class('autosize'),
|
||||
username=dom.input(
|
||||
attr.required(''),
|
||||
attr.placeholder('jane@example.org'),
|
||||
function change() { autosize.dataset.value = username.value },
|
||||
function input() { autosize.dataset.value = username.value },
|
||||
),
|
||||
),
|
||||
),
|
||||
dom.label(
|
||||
style({display: 'block', marginBottom: '2ex'}),
|
||||
@ -1476,6 +1484,7 @@ const compose = (opts: ComposeOptions) => {
|
||||
autosizeElem.dataset.value = inputElem.value
|
||||
},
|
||||
function change() {
|
||||
autosizeElem.dataset.value = inputElem.value
|
||||
fetchRecipientSecurity()
|
||||
},
|
||||
),
|
||||
|
Reference in New Issue
Block a user