mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) When searching, use formatter.formatAny() to handle values of invalid type.
Summary: This turns out necessary because ReferenceList columns are formatted using the formatter of the associated visibleCol. This works correctly in dedicated widgets, but in generic code (like SearchModel here), this formatter needs to handle unexpected values (of type ReferenceList). Without the fix, it produces JS errors when search reaches a RefList:<Date> column. A better fix would allow a formatter to know that it expects a ReferenceList, AND to know how to format each value of it, but that's a bigger question that's outside the scope of this fix. Test Plan: Includes a browser test which reproduces the bug. Reviewers: cyprien Reviewed By: cyprien Differential Revision: https://phab.getgrist.com/D3195
This commit is contained in:
@@ -266,7 +266,7 @@ class FinderImpl implements IFinder {
|
||||
const value = this._sectionTableData.getValue(rowId, displayCol.colId.peek());
|
||||
|
||||
// TODO: Note that formatting dates is now the bulk of the performance cost.
|
||||
const text = formatter.format(value);
|
||||
const text = formatter.formatAny(value);
|
||||
return this._searchRegexp.test(text);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user