diff --git a/packages/qwik/src/core/v2/shared/scheduler.ts b/packages/qwik/src/core/v2/shared/scheduler.ts index 70615f0ed5f..1692d99549d 100644 --- a/packages/qwik/src/core/v2/shared/scheduler.ts +++ b/packages/qwik/src/core/v2/shared/scheduler.ts @@ -418,11 +418,8 @@ function choreComparator(a: Chore, b: Chore, shouldThrowOnHostMismatch: boolean) const aHost = a.$host$; const bHost = b.$host$; - const aHostIsQrlResolve = a.$type$ === ChoreType.QRL_RESOLVE; - const bHostIsQrlResolve = b.$type$ === ChoreType.QRL_RESOLVE; - // QRL_RESOLVE does not have a host. - if (aHost !== bHost && !aHostIsQrlResolve && !bHostIsQrlResolve) { + if (aHost !== bHost && aHost !== null && bHost !== null) { if (vnode_isVNode(aHost) && vnode_isVNode(bHost)) { // we are running on the client. const hostDiff = vnode_documentPosition(aHost, bHost); @@ -449,22 +446,20 @@ function choreComparator(a: Chore, b: Chore, shouldThrowOnHostMismatch: boolean) return microTypeDiff; } - /** - * QRL_RESOLVE is a special case. It does not have a host nor $idx$. We want to process - * QRL_RESOLVE chores as FIFO, so we need to return 1. - */ - if ( - aHostIsQrlResolve && - bHostIsQrlResolve && - (a.$target$ as QRLInternal).$symbol$ !== (b.$target$ as QRLInternal).$symbol$ - ) { - return 1; - } - const idxDiff = toNumber(a.$idx$) - toNumber(b.$idx$); if (idxDiff !== 0) { return idxDiff; } + + // If the host is the same, we need to compare the target. + if ( + a.$target$ !== b.$target$ && + ((a.$type$ === ChoreType.QRL_RESOLVE && b.$type$ === ChoreType.QRL_RESOLVE) || + (a.$type$ === ChoreType.NODE_PROP && b.$type$ === ChoreType.NODE_PROP)) + ) { + // 1 means that we are going to process chores as FIFO + return 1; + } } return 0; diff --git a/packages/qwik/src/core/v2/tests/component.spec.tsx b/packages/qwik/src/core/v2/tests/component.spec.tsx index e542d154efd..0909c74e506 100644 --- a/packages/qwik/src/core/v2/tests/component.spec.tsx +++ b/packages/qwik/src/core/v2/tests/component.spec.tsx @@ -26,7 +26,7 @@ Error.stackTraceLimit = 100; describe.each([ { render: ssrRenderToDom }, // - // { render: domRender }, // + { render: domRender }, // ])('$render.name: component', ({ render }) => { it('should render component', async () => { const MyComp = component$(() => { diff --git a/starters/e2e/e2e.attributes.e2e.ts b/starters/e2e/e2e.attributes.e2e.ts index fa911ba4ef2..f648219ce01 100644 --- a/starters/e2e/e2e.attributes.e2e.ts +++ b/starters/e2e/e2e.attributes.e2e.ts @@ -135,8 +135,8 @@ test.describe("attributes", () => { test("should update required", async ({ page }) => { const input = page.locator("#input"); const renders = page.locator("#renders"); - const countBtn = page.locator("#required"); - await countBtn.click(); + const requiredBtn = page.locator("#required"); + await requiredBtn.click(); await expect(input).toHaveAttribute("aria-hidden", "true"); await expect(input).toHaveAttribute("aria-label", "even");