disable search onChange & fix recent workspace

This commit is contained in:
zhandouxiaojiji committed 2020-11-26 15:03:39 +08:00
1 parent 1240547930
commit 00b08988ca
3 files changed
+14 -8

No files matched your search

+9 -3
View File
@@ -109,9 +109,15 @@ export default class Settings {
} }
pushRecentWorkspace(path: string) { pushRecentWorkspace(path: string) {
if (this.model.recentWorkspaces.indexOf(path) < 0) { var list = this.model.recentWorkspaces;
this.model.recentWorkspaces.unshift(path); if (list.indexOf(path) >= 0) {
list = list.filter((value) => value !== path);
}
list.unshift(path);
while(list.length > 10) {
list.pop();
}
this.model.recentWorkspaces = list;
this.save(); this.save();
} }
}
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "behavior3editor", "name": "behavior3editor",
"version": "0.1.0", "version": "0.1.1",
"description": "行为树编辑器", "description": "行为树编辑器",
"main": "./dist/main.js", "main": "./dist/main.js",
"scripts": { "scripts": {
+4 -4
View File
@@ -344,10 +344,10 @@ export default class Properties extends Component<PropertiesProps> {
<Search <Search
allowClear allowClear
placeholder="Search" placeholder="Search"
onChange={(e)=>{ // onChange={(e)=>{
const value = e.target.value?.toLowerCase(); // const value = e.target.value?.toLowerCase();
this.handleOnSearch(value); // this.handleOnSearch(value);
}} // }}
onSearch={ onSearch={
(value,event)=>{ (value,event)=>{
this.handleOnSearch(value?.toLowerCase()); this.handleOnSearch(value?.toLowerCase());