Fix regression that prevented custom placeholders from working (#9994)
This commit is contained in:
parent
7cd0e4ad21
commit
69456eba51
|
@ -42,9 +42,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const getFieldText = (value, options, placeholder) => {
|
const getFieldText = (value, options, placeholder) => {
|
||||||
// Always use placeholder if no value
|
|
||||||
if (value == null || 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)
|
return getFieldAttribute(getOptionLabel, value, options)
|
||||||
|
|
Loading…
Reference in New Issue