diff --git a/packages/mui-material/src/InputBase/utils.js b/packages/mui-material/src/InputBase/utils.js index 11f757bb54914e..8ea2aca25921e8 100644 --- a/packages/mui-material/src/InputBase/utils.js +++ b/packages/mui-material/src/InputBase/utils.js @@ -18,15 +18,13 @@ export function hasValue(value) { export function isFilled(obj, SSR = false) { return ( obj && - ( - (hasValue(obj.value) && obj.value !== "") || + ((hasValue(obj.value) && obj.value !== '') || // If the input type is different from text (like number or date), // some browsers displays the invalid input value while the obj.value // is blank. So to proper shrink the label in case of invalid input, // the following test is needed obj.validity?.badInput || - (SSR && hasValue(obj.defaultValue) && obj.defaultValue !== "") - ) + (SSR && hasValue(obj.defaultValue) && obj.defaultValue !== '')) ); } diff --git a/packages/mui-material/src/InputBase/utils.test.js b/packages/mui-material/src/InputBase/utils.test.js index 3e5f0a6e8bc3e2..b8d9f41d3dc44b 100644 --- a/packages/mui-material/src/InputBase/utils.test.js +++ b/packages/mui-material/src/InputBase/utils.test.js @@ -37,7 +37,7 @@ describe('Input/utils.js', () => { }); it(`is true if bad input`, () => { - expect(isFilled({validity: {badInput: true}})).to.equal(true); - }) + expect(isFilled({ validity: { badInput: true } })).to.equal(true); + }); }); });