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.

Chip element goes full-width in MS Edge

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

When using the Chip element, behavior differs in browser. While in Chrome it has width calculated based on label and avatar, in MS Edge the element is 100% width. I did a CodeSandbox snippet to reproduce it.

Expected Behavior

The Chip should be as narrow as its content, like it does in Chrome

Current Behavior

On MS Edge (versions: Microsoft Edge 41.16299.15.0; Microsoft EdgeHTML 16.16299) the Chip element is full width

Steps to Reproduce (for bugs)

  1. CodeSandbox snippet
  2. Add a Chip element to App
  3. The rendering differs in Chrome and Edge
  4. Wrapping Chip with inline-flex container (e.g. Badge or custom div) fixes an issue.

Context

I’m rendering a statistic page, where Avatar shows ID and label displays aggregation data. I show each chip on new line (in a narrow Grid element) so it’s not a big problem, but in this case Avatar is not left-most.

Your Environment

Tech Version
Material-UI 1.0.0-beta.24
React 16.2
browser Edge
Microsoft Edge 41.16299.15.0
Microsoft EdgeHTML 16.16299

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
IBestuzhevcommented, Dec 27, 2017

@oliviertassinari I discovered this fix as I have some Chips wrapped in Badge. But looks like it works even if applied to Chip itself, without wrapping:

<Chip label="Fix no wrapped" avatar={<Avatar>{3}</Avatar>} style={{display: "inline-flex"}} />

I think it’s OK. The chip element is inline by design, so this solution looks natural.
I hope it does not break other cases.

1reaction
IBestuzhevcommented, Dec 26, 2017

I take a look at styles and see that Chip Element has width: fit-content. But intrinsic-width properties are not supported by MS: caniuse and Edge dev site. It’s under consideration with low priority.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chip element goes full-width in MS Edge · Issue #9615 - GitHub
When using the Chip element, behavior differs in browser. While in Chrome it has width calculated based on label and avatar, in MS...
Read more >
Header and content always full width on Microsoft Edge and ...
In Microsoft Edge and Microsoft Internet Explorer, the header as well as all content are always in full width and the site looks...
Read more >
How to fix Microsoft Edge displaying incorrect table cell widths ...
When a child element with a defined width is placed within the bottom cell which has a colspan , Microsoft Edge displays the...
Read more >
How To Hide Scrollbars With CSS - W3Schools
IE and Edge supports the -ms-overflow-style: property, and Firefox supports the scrollbar-width property, which allows us to hide the scrollbar, but keep ...
Read more >
Use web parts with the full-width column | Microsoft Learn
Modern pages in communication sites offer an additional section layout named Full-width column. This layout spans the full width of the page ...
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