From 19c02fc91c8740dc3e47de5bf31c94097bd5516b Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 16 Jan 2023 08:55:31 -0700 Subject: [PATCH] Et2InputWidget: Do not try to validate readonly widgets, user can't change the value to fix it --- api/js/etemplate/Et2InputWidget/Et2InputWidget.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts b/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts index 2d15d9ca5f..5b00ab1894 100644 --- a/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts +++ b/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts @@ -444,6 +444,11 @@ const Et2InputWidgetMixin = >(superclass : T) */ async validate() { + if(this.readonly) + { + // Don't validate if the widget is read-only, there's nothing the user can do about it + return Promise.resolve(); + } let validators = [...(this.validators || []), ...(this.defaultValidators || [])]; let fieldName = this.id; let feedbackData = [];