[ui] DomiUi: @domi/ui v1.2.0; on Android the town field is an editable box, so focusing it sends no Autofill request (TextField as=auto)
This commit is contained in:
@@ -512,6 +512,43 @@ textarea.domi-field__input {
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
/*
|
||||
* Editable mode (as="editable"): a contenteditable box in place of <input>/<textarea>, so an Android WebView sends no
|
||||
* Autofill request. One line: centred, no wrap, scrolls sideways. Several lines: grows to --_rows-max, then scrolls.
|
||||
*/
|
||||
.domi-field__input--editable {
|
||||
align-self: center;
|
||||
min-height: var(--domi-leading-md);
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
white-space: pre;
|
||||
cursor: text;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.domi-field__input--editable::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.domi-field__input--lines {
|
||||
align-self: stretch;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
min-height: calc(var(--domi-leading-md) + 16px);
|
||||
max-height: calc(var(--domi-leading-md) * var(--_rows-max, 8) + 16px);
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: anywhere;
|
||||
scrollbar-width: thin;
|
||||
}
|
||||
.domi-field__input--editable:empty::before {
|
||||
content: attr(data-placeholder);
|
||||
color: var(--domi-muted);
|
||||
pointer-events: none;
|
||||
}
|
||||
.domi-field__input--editable[contenteditable='false'] {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* The seal: the send button set into the right end of the field. */
|
||||
.domi-send {
|
||||
--_s: max(var(--domi-size-send-md), var(--domi-send-target));
|
||||
@@ -606,6 +643,30 @@ textarea.domi-field__input {
|
||||
.domi-field:not([data-empty]) .domi-send:not([aria-disabled='true']) .domi-icon {
|
||||
animation: domi-rise var(--domi-dur-state) var(--domi-ease-release) 1;
|
||||
}
|
||||
/*
|
||||
* Without a script (a static page: Aula): the seal lies flat while the field is empty, from CSS alone. Give the
|
||||
* <input> or <textarea> a placeholder (placeholder=" " if it shows none). The seal stays an enabled, focusable button
|
||||
* here: the server must treat an empty submit as nothing. Fields driven by the Svelte component (they carry
|
||||
* data-state while sending and after) are left to the script, so a cleared field keeps its lit "sent" seal.
|
||||
*/
|
||||
.domi-field:not([data-state]):has(.domi-field__input:placeholder-shown) .domi-send,
|
||||
.domi-field:not([data-state]):has(.domi-field__input:placeholder-shown) .domi-send:hover,
|
||||
.domi-field:not([data-state]):has(.domi-field__input:placeholder-shown) .domi-send:active,
|
||||
.domi-field:not([data-state]):has(.domi-field__input:placeholder-shown) .domi-send:focus-visible {
|
||||
border-color: var(--domi-line);
|
||||
background: transparent;
|
||||
color: var(--domi-disabled);
|
||||
box-shadow: none;
|
||||
cursor: default;
|
||||
transform: none;
|
||||
}
|
||||
.domi-field:not([data-state]):has(.domi-field__input:placeholder-shown) .domi-send::before,
|
||||
.domi-field:not([data-state]):has(.domi-field__input:placeholder-shown) .domi-send::after {
|
||||
animation: none;
|
||||
}
|
||||
.domi-field:not([data-state]):has(.domi-field__input:placeholder-shown) .domi-send .domi-icon {
|
||||
animation: none;
|
||||
}
|
||||
.domi-send[data-state='sending'] {
|
||||
cursor: progress;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user