sp-dev-fx-property-controls
sp-dev-fx-property-controls copied to clipboard
FilePicker Sorting Does Not Work
Category
- [ ] Enhancement
- [x] Bug
- [ ] Question
Version
Please specify what version of the library you are using: [1.9.0]
Expected / Desired Behavior / Question
The FilePicker control should be able to sort on any of the columns it shows (name, modified date, modified by, size).
Observed Behavior
When using the FilePicker control, sorting works fine (for me) on the Modifed By column, but all other sorts don't work properly at all (they seem kind of random). Further, when I look at the code (e.g. https://github.com/pnp/sp-dev-fx-property-controls/blob/master/src/propertyFields/filePicker/filePickerControls/controls/FileBrowser/FileBrowser.tsx#L382) I can see there's no "same" condition handled (for instance see at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description that 3 results are possible, not just greater than and less than but also equal to).
Steps to Reproduce
In the test harness, open the File Picker, browse to a folder, and try sort the items.
I'm working on a fix already, so hopefully this issue is just 'fyi'.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.