File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed
packages/react-devtools-shared/src/devtools/views/Components Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change 8
8
*/
9
9
10
10
import React , { Fragment , useRef } from 'react' ;
11
- import Button from '../Button' ;
12
- import ButtonIcon from '../ButtonIcon' ;
13
11
import styles from './EditableValue.css' ;
14
12
import { useEditableValue } from '../hooks' ;
15
13
@@ -61,11 +59,6 @@ export default function EditableValue({
61
59
}
62
60
} ;
63
61
64
- const handleBlur = event => {
65
- event . stopPropagation ( ) ;
66
- applyChanges ( ) ;
67
- } ;
68
-
69
62
const applyChanges = ( ) => {
70
63
if ( isValid && hasPendingChanges ) {
71
64
overrideValueFn ( path , parsedValue ) ;
@@ -84,22 +77,14 @@ export default function EditableValue({
84
77
< input
85
78
autoComplete = "new-password"
86
79
className = { `${ isValid ? styles . Input : styles . Invalid } ${ className } ` }
80
+ onBlur = { applyChanges }
87
81
onChange = { handleChange }
88
82
onKeyDown = { handleKeyDown }
89
- onBlur = { handleBlur }
90
83
placeholder = { placeholder }
91
84
ref = { inputRef }
92
85
type = "text"
93
86
value = { editableValue }
94
87
/>
95
- { hasPendingChanges && (
96
- < Button
97
- className = { styles . ResetButton }
98
- onClick = { reset }
99
- title = "Reset value" >
100
- < ButtonIcon type = "undo" />
101
- </ Button >
102
- ) }
103
88
</ Fragment >
104
89
) ;
105
90
}
You can’t perform that action at this time.
0 commit comments