Skip to content

Commit c3a31e0

Browse files
authored
Removed "Undo" button and unnecessary event.preventDefault()
1 parent 64f50f0 commit c3a31e0

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

packages/react-devtools-shared/src/devtools/views/Components/EditableValue.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
*/
99

1010
import React, {Fragment, useRef} from 'react';
11-
import Button from '../Button';
12-
import ButtonIcon from '../ButtonIcon';
1311
import styles from './EditableValue.css';
1412
import {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
}

0 commit comments

Comments
 (0)