AllenFang / AllenFang/react-bootstrap-table

Sorting of undefined properties causes undefined result

オープン
#1,017 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。