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.

Broken Grid List styles when adding a component between List and List.Item

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

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Use List in grid mode, and wrap List.Item in a component.

I have a large UI codebase which uses a lot of wrapper components around List.Item (to use item-level hooks for example…). This used to work fine in AntDesign 3. Using the grid mode, the new version 4 breaks the styles because they are directly injected into List.Item using cloneElement.

What is expected?

Styles should be applied via style sheets, not by element cloning which is not only an unlisted breaking change from v3 but also prohibits an easy use of component wrapper around List.Item (without forwarding props).

What is actually happening?

Styles are broken. The grid layout doesn’t render correctly.

Environment Info
antd 4.2.5
React react 16.13.1
System Windows 10
Browser Chrome 81.0.4044.138

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
afc163commented, May 30, 2020
image
0reactions
lgantscommented, Jun 6, 2020

I recently noticed this behavior after updating to 4.3.1 - I’ve been using 4.x for a while without this issue. Might be related to this: https://github.com/ant-design/ant-design/pull/24280

Read more comments on GitHub >

github_iconTop Results From Across the Web

list-style - CSS: Cascading Style Sheets - MDN Web Docs
The list-style CSS shorthand property allows you to set all the list style properties at once.
Read more >
Split `list` and `item` of the Angular Material grid list ...
Therefore, the answer to my question is: It is currently not possible to separate in different Angular 2 components the list and the...
Read more >
Lists - Material Design
This demo lets you preview the list component, its variations, and configuration options. Each tab displays a different type of list.
Read more >
Totally Custom List Styles | Modern CSS Solutions
This tutorial will show how to use CSS grid layout for easy custom list styling. We'll cover CSS counters, CSS custom properties, ...
Read more >
Create lists with different types of items - Flutter documentation
You might need to create lists that display different types of content. For example, you might be working on a list that shows...
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