From aec8141336320c595f0bd565c18ab69cbdfb3ddb Mon Sep 17 00:00:00 2001 From: Maksym Tsymbarov Date: Tue, 1 Dec 2026 16:44:08 +0100 Subject: [PATCH] Fixed the Add widget dialog ignoring clicks after pressing Enter in a settings field (#16838) * Fixed widget config dialog freezing on Enter: add type="button" to non-submit buttons * Fixed Enter in widget config fields triggering Add/Preview: add type="button" and a disabled default submit button to widget config forms * Merge fixes * Fixed license headers * Apply suggestion from @vvlladd28 --------- Co-authored-by: Vladyslav Prykhodko --- .../components/alarm/alarm-filter-config.component.html | 1 + .../dashboard-page/add-widget-dialog.component.html | 4 ++++ .../components/dashboard-page/edit-widget.component.html | 9 ++++++++- .../basic/alarm/alarm-count-basic-config.component.html | 2 +- .../basic/alarm/alarms-table-basic-config.component.html | 2 +- .../basic/common/widget-actions-panel.component.html | 7 ++++--- .../action/custom-action-pretty-editor.component.html | 7 ++++--- .../button/widget-button-custom-style.component.html | 7 ++++--- .../widget-button-toggle-custom-style.component.html | 7 ++++--- .../lib/settings/common/color-range-list.component.html | 2 +- .../settings/common/date-format-select.component.html | 7 ++++--- .../widget/lib/settings/common/gradient.component.html | 7 ++++--- .../common/html/html-container-settings.component.html | 9 +++++---- .../home/components/widget/widget-config.component.html | 2 +- .../shared/components/json-object-edit.component.html | 5 +++-- 15 files changed, 49 insertions(+), 29 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/alarm/alarm-filter-config.component.html b/ui-ngx/src/app/modules/home/components/alarm/alarm-filter-config.component.html index f96a1b4ba6..41699314a3 100644 --- a/ui-ngx/src/app/modules/home/components/alarm/alarm-filter-config.component.html +++ b/ui-ngx/src/app/modules/home/components/alarm/alarm-filter-config.component.html @@ -13,6 +13,7 @@ matTooltip="{{buttonDisplayValue}}" matTooltipPosition="above" mat-stroked-button + type="button" (click)="toggleAlarmFilterPanel($event)"> filter_list{{buttonDisplayValue}} diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.html b/ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.html index 3d331ae634..4b4e81f569 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.html @@ -6,6 +6,8 @@ -->
+ +

{{'widget.add' | translate}}:

@@ -52,6 +54,7 @@ [previewHeight]="widgetConfig.typeParameters.previewHeight">
}
@if (previewMode) { diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/alarm/alarms-table-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/alarm/alarms-table-basic-config.component.html index 271530d2f0..7a4657108e 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/alarm/alarms-table-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/alarm/alarms-table-basic-config.component.html @@ -16,7 +16,7 @@
alarm.filter
- diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/common/widget-actions-panel.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/common/widget-actions-panel.component.html index ef2a677822..4e915acb6f 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/common/widget-actions-panel.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/common/widget-actions-panel.component.html @@ -1,7 +1,8 @@
@@ -18,12 +19,12 @@ } @if (!hasWidgetActions) { - } @if (hasWidgetActions) { - } diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/custom-action-pretty-editor.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/custom-action-pretty-editor.component.html index 5c85012257..479c35124f 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/custom-action-pretty-editor.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/custom-action-pretty-editor.component.html @@ -1,13 +1,14 @@
@if (!fullscreen) { -
-
-
- diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/date-format-select.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/date-format-select.component.html index 93a1f33612..27d92696b8 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/date-format-select.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/date-format-select.component.html @@ -1,7 +1,8 @@ @@ -11,13 +12,13 @@ } @if (dateFormatFormControl.value?.custom) { - } @if (dateFormatFormControl.value?.auto && !dateFormatFormControl.value?.custom) { - diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/gradient.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/gradient.component.html index 4b251eda4d..f2ff5c4499 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/gradient.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/gradient.component.html @@ -1,7 +1,8 @@ @@ -83,7 +84,7 @@
} -
} -
- diff --git a/ui-ngx/src/app/shared/components/json-object-edit.component.html b/ui-ngx/src/app/shared/components/json-object-edit.component.html index 123b150388..defd187902 100644 --- a/ui-ngx/src/app/shared/components/json-object-edit.component.html +++ b/ui-ngx/src/app/shared/components/json-object-edit.component.html @@ -1,7 +1,8 @@
} -