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:
@@ -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 (
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user