Fix cursor appearance, remove dead code

This commit is contained in:
HarelM
2025-09-17 10:24:03 +03:00
parent 53e6be1ead
commit 7459379e92
+1 -8
View File
@@ -30,14 +30,12 @@ class InputJsonInternal extends React.Component<InputJsonInternalProps, InputJso
onFocus: () => {}, onFocus: () => {},
onBlur: () => {}, onBlur: () => {},
}; };
_keyEvent: string;
_view: EditorView | undefined; _view: EditorView | undefined;
_el: HTMLDivElement | null = null; _el: HTMLDivElement | null = null;
_cancelNextChange: boolean = false; _cancelNextChange: boolean = false;
constructor(props: InputJsonInternalProps) { constructor(props: InputJsonInternalProps) {
super(props); super(props);
this._keyEvent = "keyboard";
this.state = { this.state = {
isEditing: false, isEditing: false,
prevValue: this.getPrettyJson(this.props.value), prevValue: this.getPrettyJson(this.props.value),
@@ -60,10 +58,6 @@ class InputJsonInternal extends React.Component<InputJsonInternalProps, InputJso
}); });
} }
onPointerDown = () => {
this._keyEvent = "pointer";
};
onFocus = () => { onFocus = () => {
if (this.props.onFocus) this.props.onFocus(); if (this.props.onFocus) this.props.onFocus();
this.setState({ this.setState({
@@ -72,7 +66,6 @@ class InputJsonInternal extends React.Component<InputJsonInternalProps, InputJso
}; };
onBlur = () => { onBlur = () => {
this._keyEvent = "keyboard";
if (this.props.onBlur) this.props.onBlur(); if (this.props.onBlur) this.props.onBlur();
this.setState({ this.setState({
isEditing: false, isEditing: false,
@@ -127,7 +120,7 @@ class InputJsonInternal extends React.Component<InputJsonInternalProps, InputJso
style.maxHeight = this.props.maxHeight; style.maxHeight = this.props.maxHeight;
} }
return <div className="JSONEditor" data-wd-key="json-editor" onPointerDown={this.onPointerDown} aria-hidden="true"> return <div className="json-editor" data-wd-key="json-editor" aria-hidden="true" style={{cursor: "text"}}>
<div <div
className={classnames("codemirror-container", this.props.className)} className={classnames("codemirror-container", this.props.className)}
ref={(el) => {this._el = el;}} ref={(el) => {this._el = el;}}