From 8eaba806d411ef70877688a3ff075bd37068f3ce Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 20 Mar 2023 09:12:50 +0000 Subject: [PATCH] Fix regression that prevented custom placeholders from working (#9994) --- packages/bbui/src/Form/Core/Select.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/bbui/src/Form/Core/Select.svelte b/packages/bbui/src/Form/Core/Select.svelte index af45c1d9ff..2fad886910 100644 --- a/packages/bbui/src/Form/Core/Select.svelte +++ b/packages/bbui/src/Form/Core/Select.svelte @@ -42,9 +42,13 @@ } const getFieldText = (value, options, placeholder) => { - // Always use placeholder if no value if (value == null || value === "") { - return placeholder !== false ? "Choose an option" : "" + // Explicit false means use no placeholder and allow an empty fields + if (placeholder === false) { + return "" + } + // Otherwise we use the placeholder if possible + return placeholder || "Choose an option" } return getFieldAttribute(getOptionLabel, value, options)