Skip to content

Commit 109f1ab

Browse files
[TextField] Remove the support for a rare edge-case
1 parent d1a7d76 commit 109f1ab

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

packages/material-ui/src/InputBase/InputBase.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,7 @@ class InputBase extends React.Component {
172172
}
173173
}
174174

175-
componentDidUpdate(prevProps) {
176-
// Book keep the focused state.
177-
if (!prevProps.disabled && this.props.disabled) {
178-
const { muiFormControl } = this.props;
179-
if (muiFormControl && muiFormControl.onBlur) {
180-
muiFormControl.onBlur();
181-
}
182-
}
175+
componentDidUpdate() {
183176
if (this.isControlled) {
184177
this.checkDirty(this.props);
185178
} // else performed in the onChange

packages/material-ui/src/InputBase/InputBase.test.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ describe('<InputBase />', () => {
7575
});
7676

7777
it('should reset the focused state', () => {
78-
const handleBlur = spy();
79-
const wrapper = mount(<InputBase muiFormControl={{ onBlur: handleBlur }} />);
78+
const wrapper = mount(<InputBase />);
8079
// We simulate a focused input that is getting disabled.
8180
setState(wrapper, {
8281
focused: true,
@@ -85,7 +84,6 @@ describe('<InputBase />', () => {
8584
disabled: true,
8685
});
8786
assert.strictEqual(wrapper.find('InputBase').state().focused, false);
88-
assert.strictEqual(handleBlur.callCount, 1);
8987
});
9088

9189
// IE 11 bug

0 commit comments

Comments
 (0)