AllenFang / AllenFang/react-bootstrap-table
Sorting of undefined properties causes undefined result
未关闭
enhancement
in progress
- 主要语言
- JavaScript
- 星标
- 2.2k
- 派生
- 761
- PR 合并指标
- 30 天内没有已合并 PR
描述
In my data, some records are missing a property that I display in a sortable column.
I assume this results in the value used for comparisons being `undefined` which messes up sorting. Strangely enough, Chrome still sorts as unexpected but Firefox messes up.
I already did some browsing and found that `null` is handled specially but not `undefined`
https://github.com/AllenFang/react-bootstrap-table/blob/master/src/store/TableDataStore.js#L565
I guess its because the comparison operators `<` and `>` cause unexpected results in combination with `undefined` operands, e.g.:
```javascript
"a" < undefined
false
undefined < "a"
false
```
贡献指南
评估
这个 Issue 还没有评估数据。