Skip to content

Commit e2d539d

Browse files
committed
fix(cursors): setting falsy prop
1 parent 91d1ec5 commit e2d539d

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

packages/qwik/src/core/client/vnode-diff.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,8 +1535,9 @@ export function cleanup(container: ClientContainer, journal: VNodeJournal, vNode
15351535
// SPECIAL CASE: If we are a component, we need to descend into the projected content and release the content.
15361536
const attrs = (vCursor as VirtualVNode).props;
15371537
if (attrs) {
1538-
for (const [key, value] of Object.entries(attrs)) {
1538+
for (const key of Object.keys(attrs)) {
15391539
if (isSlotProp(key)) {
1540+
const value = attrs[key];
15401541
if (value) {
15411542
attrs[key] = null; // prevent infinite loop
15421543
const projection =
@@ -1565,7 +1566,9 @@ export function cleanup(container: ClientContainer, journal: VNodeJournal, vNode
15651566
vCursor = vFirstChild;
15661567
continue;
15671568
}
1568-
} else if (vCursor === vNode) {
1569+
}
1570+
// TODO: probably can be removed
1571+
else if (vCursor === vNode) {
15691572
/**
15701573
* If it is a projection and we are at the root, then we should only walk the children to
15711574
* materialize the projection content. This is because we could have references in the vnode

packages/qwik/src/core/client/vnode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ export const vnode_getProp = <T = unknown>(
399399

400400
export const vnode_setProp = (vNode: VNode, key: string, value: unknown) => {
401401
if (vnode_isElementVNode(vNode) || vnode_isVirtualVNode(vNode)) {
402-
if (!value && vNode.props) {
402+
if (value == null && vNode.props) {
403403
delete vNode.props[key];
404404
} else {
405405
vNode.props ||= {};

packages/qwik/src/core/shared/cursor/cursor-queue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { VNodeFlags } from '../../client/types';
88
import type { Container } from '../types';
99
import type { Cursor } from './cursor';
10-
import { getCursorData, setCursorData } from './cursor-props';
10+
import { getCursorData } from './cursor-props';
1111

1212
/** Global cursor queue array. Cursors are sorted by priority. */
1313
let globalCursorQueue: Cursor[] = [];

0 commit comments

Comments
 (0)