File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 160
160
padding : 0 ;
161
161
border-radius : 3px ;
162
162
background : # ededed ;
163
+ width : 100% ;
163
164
}
164
165
.dlp-dot-menu > .menu-list .dot-search {height : 24px }
165
166
.dlp-dot-menu > .menu-list > .list {width : 100% ;max-height : 150px ;overflow-y : auto;padding : 0 0 2px 0 ;}
Original file line number Diff line number Diff line change @@ -1119,6 +1119,24 @@ window.ComponentLine = class {
1119
1119
let input = document . createElement ( 'input' ) ;
1120
1120
input . className = 'dlp dlp-input dot-search' ;
1121
1121
input . setAttribute ( 'placeholder' , '搜索' ) ;
1122
+ input . addEventListener ( 'input' , ( ) => {
1123
+ setTimeout ( ( ) => {
1124
+ if ( input . value === '' ) {
1125
+ for ( let node of list . childNodes ) {
1126
+ node . style . display = 'flex' ;
1127
+ }
1128
+ return ;
1129
+ }
1130
+ for ( let node of list . childNodes ) {
1131
+ let text = node . firstElementChild . innerText ;
1132
+ if ( text . indexOf ( input . value ) !== - 1 || input . value . indexOf ( text ) !== - 1 ) {
1133
+ node . style . display = 'flex' ;
1134
+ } else {
1135
+ node . style . display = 'none' ;
1136
+ }
1137
+ }
1138
+ } , 300 ) ;
1139
+ } ) ;
1122
1140
1123
1141
let list = document . createElement ( 'div' ) ;
1124
1142
list . className = 'list dlp-scroll' ;
You can’t perform that action at this time.
0 commit comments