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
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:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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