Skip to content

Commit

Permalink
Apply code style
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirguerra committed Dec 28, 2021
1 parent dbd628c commit 16815b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions packages/mui-material/src/InputBase/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 !== ''))
);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/mui-material/src/InputBase/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
});

0 comments on commit 16815b8

Please sign in to comment.