question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Autocomplete] Adding startAdornment results in extra top padding on IE11 only

See original GitHub issue
  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

Using a startAdornment on AutoComplete’s renderInput results in an extra top padding on IE11.

We’ve seen it with the outlined variant, but only when we set a placeholder.(i.e. works with label).

Manually setting the TextField’s notched property to false appears to “fix” it.

Here’s the issue in action (the table structure mimicks the components’ placement on the screenshots):

Chrome Label Placeholder
Regular
Label + startAdornment Placeholder + startAdornment
IE11 Label Placeholder Padded
Label + startAdornment Placeholder + startAdornment

Inspecting the generated DOM element shows that the <fieldset> tag has a top: -5px property which, when cleared, fixes the issue:

Inspected
.PrivateNotchedOutline-root-85 {
  top: -5px;    <-----
  left: 0;
  right: 0;
  ...
}

Expected Behavior 🤔

Should be identical to the other browsers (tested on 5 others, listed below)

Steps to Reproduce 🕹

The modified Material UI autocomplete demo above should show the issue, but unfortunately codesandbox.io is currently broken on IE11 due to transpiling issues.

The gist of the demo is to create an AutoComplete with the placeholder and startAdornment params set on renderInput’s TextField and visualize it on IE11:

renderInput={params => (
  <TextField
    {...params}
    placeholder="Placeholder text"
    variant="outlined"
    InputProps={{
      ...params.InputProps,
      startAdornment: <span>span</span>
    }}
    fullWidth
  />
)}

Context 🔦

We’re happy MaterialUI users with IE11 users 😄

Your Environment 🌎

Tech Version
@material-ui/core 4.7.2
@material-ui/lab 4.0.0-alpha.38
React 16.12.0
Browser IE11 (❌ ), Chrome 79 (✅) , Firefox 72(✅), Edge 18(✅ , Edge 79(✅ ), Safari 13 (✅ )

Thanks for this great project!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
oliviertassinaricommented, Jan 20, 2020

“Please mind the gap between the train and the station” 🙉

2reactions
aisamucommented, Jan 20, 2020

Don’t worry about the gap

London Underground would like to have a word with you

it’s another issue and being taken care of.

Again, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Autocomplete] Adding startAdornment results in extra top ...
Using a startAdornment on AutoComplete's renderInput results in an extra top padding on IE11. We've seen it with the outlined variant, but only...
Read more >
Turn AutoComplete on in Internet Explorer 11
To update AutoComplete settings: In the search box on the taskbar, type Internet Explorer and then choose it from the results. Select Tools...
Read more >
reactjs - Material UI - Autocomplete Styling - Stack Overflow
I am trying to style the padding so that ...
Read more >
material-ui/core/CHANGELOG.md - UNPKG
- Start to add deprecations in anticipation of v5. We plan to add a deprecation for any breaking change in v5 that allows...
Read more >
CSS Grid in IE: Faking an Auto-Placement Grid with Gaps
The only other safe way I've found to do that is with padding. By adding 1px of padding to the top and bottom...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found