File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
packages/semi-ui/jsonViewer Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ class JsonViewerCom extends BaseComponent<JsonViewerProps, JsonViewerState> {
55
55
private editorRef : React . RefObject < HTMLDivElement > ;
56
56
private searchInputRef : React . RefObject < HTMLInputElement > ;
57
57
private replaceInputRef : React . RefObject < HTMLInputElement > ;
58
+ private isComposing : boolean = false ;
58
59
59
60
foundation : JsonViewerFoundation ;
60
61
@@ -190,6 +191,16 @@ class JsonViewerCom extends BaseComponent<JsonViewerProps, JsonViewerState> {
190
191
className = { `${ prefixCls } -search-bar-input` }
191
192
onChange = { ( _value , e ) => {
192
193
e . preventDefault ( ) ;
194
+ if ( ! this . isComposing ) {
195
+ this . searchHandler ( ) ;
196
+ }
197
+ this . searchInputRef . current ?. focus ( ) ;
198
+ } }
199
+ onCompositionStart = { ( ) => {
200
+ this . isComposing = true ;
201
+ } }
202
+ onCompositionEnd = { ( ) => {
203
+ this . isComposing = false ;
193
204
this . searchHandler ( ) ;
194
205
this . searchInputRef . current ?. focus ( ) ;
195
206
} }
You can’t perform that action at this time.
0 commit comments