Skip to content

Commit

Permalink
fix(Dropdown): comment will be treat as VNode in vue3, close #975
Browse files Browse the repository at this point in the history
  • Loading branch information
Javey committed Mar 7, 2024
1 parent 7efcdda commit aec133d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class Dropdown<
// ignore whitespaces between elements in Vue
if ((this as any).$isVue || (this as any).$isVueNext) {
if (Array.isArray(children)) {
children = children.filter(child => child !== ' ');
children = children.filter(child => child !== ' ' && child /* comment is null in vue3 */);
}
}
if (process.env.NODE_ENV !== 'production') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('Dropdown', () => {
<DropdownItem>item 2</DropdownItem>
<DropdownItem>item 3</DropdownItem>
</DropdownMenu>
<!-- comment -->
</Dropdown>
</div>
`,
Expand Down

0 comments on commit aec133d

Please sign in to comment.