From 4901257dd1f21db88b3cf9fd8583b03f6644ddfe Mon Sep 17 00:00:00 2001 From: Will Eastcott Date: Tue, 6 Jan 2026 12:52:22 +0000 Subject: [PATCH] [FIX] Fix createFn being blocked by empty input validation --- src/components/SelectInput/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/SelectInput/index.ts b/src/components/SelectInput/index.ts index aeef71a6..f7597683 100644 --- a/src/components/SelectInput/index.ts +++ b/src/components/SelectInput/index.ts @@ -394,9 +394,10 @@ class SelectInput extends Element implements IBindable, IFocusable { // during change event if (label.destroyed) return; label.text = value; - // Hide the create label if the value is invalid (in invalidOptions, empty, or whitespace-only) + // Hide the create label if the value is invalid (in invalidOptions, empty, or whitespace-only). + // Skip the empty/whitespace check if there's a createFn, as it may handle empty values (e.g., show a dialog). const invalid = (this.invalidOptions && this.invalidOptions.indexOf(value) !== -1) || - !value || value.trim() === ''; + (!this._createFn && (!value || value.trim() === '')); if (invalid) { if (!container.hidden) { container.hidden = true; @@ -415,8 +416,9 @@ class SelectInput extends Element implements IBindable, IFocusable { const text = label.text; - // Validate that the value is not empty or whitespace-only - if (!text || text.trim() === '') { + // Validate that the value is not empty or whitespace-only. + // Skip this check if there's a createFn, as it may handle empty values (e.g., show a dialog). + if (!this._createFn && (!text || text.trim() === '')) { return; }