|
@@ -55,6 +55,7 @@ class JsonViewerCom extends BaseComponent<JsonViewerProps, JsonViewerState> {
|
|
private editorRef: React.RefObject<HTMLDivElement>;
|
|
private editorRef: React.RefObject<HTMLDivElement>;
|
|
private searchInputRef: React.RefObject<HTMLInputElement>;
|
|
private searchInputRef: React.RefObject<HTMLInputElement>;
|
|
private replaceInputRef: React.RefObject<HTMLInputElement>;
|
|
private replaceInputRef: React.RefObject<HTMLInputElement>;
|
|
|
|
+ private isComposing: boolean = false;
|
|
|
|
|
|
foundation: JsonViewerFoundation;
|
|
foundation: JsonViewerFoundation;
|
|
|
|
|
|
@@ -190,6 +191,16 @@ class JsonViewerCom extends BaseComponent<JsonViewerProps, JsonViewerState> {
|
|
className={`${prefixCls}-search-bar-input`}
|
|
className={`${prefixCls}-search-bar-input`}
|
|
onChange={(_value, e) => {
|
|
onChange={(_value, e) => {
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
|
|
+ if (!this.isComposing) {
|
|
|
|
+ this.searchHandler();
|
|
|
|
+ }
|
|
|
|
+ this.searchInputRef.current?.focus();
|
|
|
|
+ }}
|
|
|
|
+ onCompositionStart={() => {
|
|
|
|
+ this.isComposing = true;
|
|
|
|
+ }}
|
|
|
|
+ onCompositionEnd={() => {
|
|
|
|
+ this.isComposing = false;
|
|
this.searchHandler();
|
|
this.searchHandler();
|
|
this.searchInputRef.current?.focus();
|
|
this.searchInputRef.current?.focus();
|
|
}}
|
|
}}
|