1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-16 03:06:27 +00:00

improve FolderSelect

maximum height and filtering by name
This commit is contained in:
Dick Choi
2016-09-08 22:02:07 +09:00
parent 6fc421810f
commit 0a707b3f02
2 changed files with 7 additions and 1 deletions

View File

@@ -200,6 +200,11 @@ class FolderSelect extends React.Component {
let currentOption = options.filter((option) => option.storage.key === storageKey && option.folder.key === folderKey)[0]
if (this.state.search.trim().length > 0) {
let filter = new RegExp('^' + _.escapeRegExp(this.state.search), 'i')
options = options.filter((option) => filter.test(option.folder.name))
}
let optionList = options
.map((option, index) => {
return (