mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Fix error when filtering empty choice and choice list columns
Summary: A client error should no longer be thrown when filtering an empty Choice or Choice List column. Test Plan: Browser tests. Reviewers: alexmojaki Reviewed By: alexmojaki Subscribers: alexmojaki Differential Revision: https://phab.getgrist.com/D3528
This commit is contained in:
@@ -342,7 +342,7 @@ function getEmptyCountMap(fieldOrColumn: ViewFieldRec|ColumnRec): Map<CellValue,
|
||||
values = [true, false];
|
||||
} else if (['Choice', 'ChoiceList'].includes(columnType)) {
|
||||
const options = fieldOrColumn.origCol().widgetOptionsJson;
|
||||
values = options.prop('choices')();
|
||||
values = options.prop('choices')() ?? [];
|
||||
}
|
||||
return new Map(values.map((v) => [v, {label: String(v), count: 0, displayValue: v}]));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user