Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit ada159c

Browse files
committed
fix: list item props forwarding
1 parent 5a5fa0c commit ada159c

File tree

1 file changed

+17
-18
lines changed
  • packages/chakra-ui-core/src/CList

1 file changed

+17
-18
lines changed

packages/chakra-ui-core/src/CList/CList.js

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import { cleanChildren, isDef, cloneVNodeElement, createStyledAttrsMixin } from '../utils'
1111
import { SNA } from '../config/props/props.types'
1212

13-
import CPseudoBox from '../CPseudoBox'
1413
import CIcon from '../CIcon'
1514

1615
/**
@@ -23,7 +22,7 @@ import CIcon from '../CIcon'
2322
*/
2423
const CList = {
2524
name: 'CList',
26-
mixins: [createStyledAttrsMixin('CList')],
25+
mixins: [createStyledAttrsMixin('CList', true)],
2726
props: {
2827
styleType: {
2928
type: String,
@@ -57,11 +56,12 @@ const CList = {
5756
return vnode
5857
}
5958

60-
return cloneVNodeElement(vnode, {
61-
props: {
62-
spacing: this.spacing
59+
const clone = cloneVNodeElement(vnode, {
60+
attrs: {
61+
mb: this.spacing
6362
}
6463
}, h)
64+
return clone
6565
})
6666

6767
return h('ul', {
@@ -82,23 +82,22 @@ const CList = {
8282
*/
8383
const CListItem = {
8484
name: 'CListItem',
85-
functional: true,
85+
mixins: [createStyledAttrsMixin('CListItem')],
8686
props: {
8787
spacing: SNA
8888
},
89-
render (h, { props, slots, data, ...rest }) {
90-
return h(CPseudoBox, {
91-
...rest,
92-
props: {
93-
as: 'li',
94-
...props
95-
},
96-
attrs: {
97-
mb: props.spacing,
98-
...data.attrs,
99-
'data-chakra-component': 'CListItem'
89+
computed: {
90+
componentStyles () {
91+
return {
92+
mb: this.spacing
10093
}
101-
}, slots().default)
94+
}
95+
},
96+
render (h) {
97+
return h('li', {
98+
class: [this.className],
99+
attrs: this.computedAttrs
100+
}, this.$slots.default)
102101
}
103102
}
104103

0 commit comments

Comments
 (0)