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 88 */
99
1010import React , { Fragment , useRef } from 'react' ;
11- import Button from '../Button' ;
12- import ButtonIcon from '../ButtonIcon' ;
1311import styles from './EditableValue.css' ;
1412import { useEditableValue } from '../hooks' ;
1513
@@ -61,11 +59,6 @@ export default function EditableValue({
6159 }
6260 } ;
6361
64- const handleBlur = event => {
65- event . stopPropagation ( ) ;
66- applyChanges ( ) ;
67- } ;
68-
6962 const applyChanges = ( ) => {
7063 if ( isValid && hasPendingChanges ) {
7164 overrideValueFn ( path , parsedValue ) ;
@@ -84,22 +77,14 @@ export default function EditableValue({
8477 < input
8578 autoComplete = "new-password"
8679 className = { `${ isValid ? styles . Input : styles . Invalid } ${ className } ` }
80+ onBlur = { applyChanges }
8781 onChange = { handleChange }
8882 onKeyDown = { handleKeyDown }
89- onBlur = { handleBlur }
9083 placeholder = { placeholder }
9184 ref = { inputRef }
9285 type = "text"
9386 value = { editableValue }
9487 />
95- { hasPendingChanges && (
96- < Button
97- className = { styles . ResetButton }
98- onClick = { reset }
99- title = "Reset value" >
100- < ButtonIcon type = "undo" />
101- </ Button >
102- ) }
10388 </ Fragment >
10489 ) ;
10590}
You can’t perform that action at this time.
0 commit comments