1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +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 (

View File

@@ -57,12 +57,13 @@
.search-optionList
position fixed
max-height 450px
overflow auto
z-index 200
background-color white
border-radius 2px
box-shadow 2px 2px 10px gray
.search-optionList-item
height 34px
width 250px