3 Commits
5 changed files with 30 additions and 8 deletions

No files matched your search

+6
View File
@@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
## [2.1.3] - 2026-12-03
### Fixed
- Browser auto-translation (Chrome, Edge, Safari) is turned off for the web interface, which crashed with a `removeChild` error when the translator rewrote the page.
- Forms: Save is enabled as soon as a field is edited, without leaving the field first, and the Delete, Cancel and Save buttons no longer move when the "Unsaved changes" label appears.
## [2.1.2] - 2026-11-29
### Fixed
+2 -1
View File
@@ -1,8 +1,9 @@
<!doctype html>
<html lang="en">
<html lang="en" translate="no">
<head>
<meta charset="UTF-8" />
<meta name="google" content="notranslate" />
<base href="/" />
<meta name="oauth-client-id" content="" />
<meta name="oauth-scopes" content="" />
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "stalwart-webui",
"version": "2.1.2",
"version": "2.1.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "stalwart-webui",
"version": "2.1.2",
"version": "2.1.3",
"dependencies": {
"@daypicker/react": "^10.0.2",
"@dnd-kit/core": "^6.3.1",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "stalwart-webui",
"private": true,
"version": "2.1.2",
"version": "2.1.3",
"stalwart": {
"minServerVersion": "1.0.0"
},
+19 -4
View File
@@ -155,6 +155,7 @@ export function DynamicForm({
const model = useDynamicForm(viewName, objectId, { accountId, fieldOverrides, createValues, showCreatedValues });
const { schema, resolved, mode, isSingleton, state, isDirty, saving, loading, loadError } = model;
const [deleteConfirmOpen, setDeleteConfirmOpen] = useState(false);
const [pendingInput, setPendingInput] = useState(false);
const title = useFormTitle(model);
const sectionPrefix = useId();
const wide = useSyncExternalStore(subscribeWide, isWide, () => false);
@@ -165,6 +166,7 @@ export function DynamicForm({
const isCreate = mode === 'create';
const readOnly = !isCreate && !canUpdate;
const canDelete = !isCreate && !isSingleton && canDestroy;
const hasChanges = isDirty || pendingInput;
const subtitle = (model.parentForm ?? model.variantForm)?.subtitle;
const errorText = state.generalError ?? loadError;
const header = (
@@ -222,7 +224,15 @@ export function DynamicForm({
<div className={cn(showIndex && 'xl:grid xl:grid-cols-[11rem_minmax(0,1fr)] xl:items-start xl:gap-6')}>
{showIndex && wide && <SectionIndex sections={model.sections} sectionId={sectionId} />}
<div className="space-y-3.5">
<div
className="space-y-3.5"
onInput={(e) => {
if (!pendingInput && e.target instanceof Node && e.currentTarget.contains(e.target)) setPendingInput(true);
}}
onBlur={() => {
if (pendingInput) setPendingInput(false);
}}
>
<FormProvider
schema={schema}
mode={mode}
@@ -266,8 +276,13 @@ export function DynamicForm({
<FloatingActionDivider />
</>
)}
{isDirty && (
<span className="flex items-center gap-2 px-2 text-[13px] text-ink-muted max-sm:hidden">
{!readOnly && (
<span
className={cn(
'flex items-center gap-2 px-2 text-[13px] text-ink-muted max-sm:hidden',
!hasChanges && 'invisible',
)}
>
<FloatingActionDot />
{t('form.unsavedChangesLabel', 'Unsaved changes')}
</span>
@@ -281,7 +296,7 @@ export function DynamicForm({
size="sm"
className="shadow-none"
onClick={() => void model.save()}
disabled={saving || (!isCreate && !isDirty)}
disabled={saving || (!isCreate && !hasChanges)}
>
{saving ? (
<Loader2 className="h-4 w-4 animate-spin" aria-hidden="true" />