Et2Select: Fix some missing "emptyLabel" bugs

- If there were no select_options, and an invalid value, empty label was not shown (Infolog pricelist)
- Select Number had numeric values for options which did not match string values (Infolog completed)
This commit is contained in:
nathan 2022-08-30 14:27:19 -06:00
parent 5cfa26bd7b
commit 6458511d75
2 changed files with 2 additions and 2 deletions

View File

@ -229,7 +229,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
*/
private fix_bad_value()
{
if(this.multiple || !Array.isArray(this.select_options) || this.select_options.length == 0)
if(this.multiple || (!this.emptyLabel && (!Array.isArray(this.select_options) || this.select_options.length == 0)))
{
// Nothing to do here
return;

View File

@ -244,7 +244,7 @@ export class StaticOptions
for(var i = 0, n = min; n <= max && i <= 100; n += interval, ++i)
{
options.push({value: n, label: sprintf(format, n)});
options.push({value: "" + n, label: sprintf(format, n)});
}
return options;
}