Skip to content

Commit f32d148

Browse files
committed
fix(TransitionGroup): filter out transition-specific props to avoid invalid HTML attributes
- Add props filtering logic to exclude transition-specific and TransitionGroup-specific props - Prevents invalid HTML attributes like 'name' from being applied to DOM elements - Fixes #13037 where TransitionGroup with tag='ul' was generating invalid HTML The filtering ensures only valid HTML attributes are passed to the rendered element, resolving W3C validation errors when using TransitionGroup with specific tags.
1 parent 75220c7 commit f32d148

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

packages/runtime-dom/src/components/TransitionGroup.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,19 @@ const TransitionGroupImpl: ComponentOptions = /*@__PURE__*/ decorate({
130130
tag = 'span'
131131
}
132132

133+
// Filter out transition-specific props and TransitionGroup-specific props
134+
// to avoid invalid HTML attributes
135+
const filteredProps: Record<string, any> = {}
136+
for (const key in rawProps) {
137+
if (
138+
!(key in TransitionPropsValidators) &&
139+
key !== 'tag' &&
140+
key !== 'moveClass'
141+
) {
142+
filteredProps[key] = (rawProps as any)[key]
143+
}
144+
}
145+
133146
prevChildren = []
134147
if (children) {
135148
for (let i = 0; i < children.length; i++) {
@@ -167,7 +180,7 @@ const TransitionGroupImpl: ComponentOptions = /*@__PURE__*/ decorate({
167180
}
168181
}
169182

170-
return createVNode(tag, null, children)
183+
return createVNode(tag, filteredProps, children)
171184
}
172185
},
173186
})

0 commit comments

Comments
 (0)