Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/modern-windows-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lynx-js/web-mainthread-apis": patch
---

fix: The `e.detail` in the `bindtap` callback needs to correctly include `x` and `y`.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const otherPropertyNames = [
'touches',
'targetTouches',
'changedTouches',
'x',
'y',
];
const blockList = new Set([
'isTrusted',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export function createCrossThreadEvent(
const params: Cloneable = {};
const isTrusted = domEvent.isTrusted;
const otherProperties: CloneableObject = {};
let detail = domEvent.detail ?? {};
if (type.match(/^transition/)) {
Object.assign(params, {
'animation_type': 'keyframe-animation',
Expand Down Expand Up @@ -79,6 +80,11 @@ export function createCrossThreadEvent(
clientX: mouseEvent.clientX,
clientY: mouseEvent.clientY,
});
} else if (type === 'click') {
detail = {
x: (domEvent as MouseEvent).x,
y: (domEvent as MouseEvent).y,
};
}
const currentTargetDatasetString = currentTargetElement?.getAttribute(
lynxDatasetAttribute,
Expand Down Expand Up @@ -109,7 +115,7 @@ export function createCrossThreadEvent(
}
: null,
// @ts-expect-error
detail: domEvent.detail ?? {},
detail,
params,
...otherProperties,
};
Expand Down
11 changes: 11 additions & 0 deletions packages/web-platform/web-tests/tests/react.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
ReturnType<typeof expect<Page>>['toHaveScreenshot']
>[0],
) => {
await expect(page).toHaveScreenshot([

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4897:5 › reactlynx3 tests › flex layout › basic-flex-item-main-axis-content-based-min-size-not-from-content-size-suggestion

9) [chromium] › tests/react.spec.ts:4897:5 › reactlynx3 tests › flex layout › basic-flex-item-main-axis-content-based-min-size-not-from-content-size-suggestion Error: expect(page).toHaveScreenshot(expected) failed 5500 pixels (ratio 0.02 of all image pixels) are different. Snapshot: basic-flex-item-main-axis-content-based-min-size-not-from-content-size-suggestion/index/index.png Call log: - Expect "toHaveScreenshot(basic-flex-item-main-axis-content-based-min-size-not-from-content-size-suggestion/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 5500 pixels (ratio 0.02 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 5500 pixels (ratio 0.02 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4903:15

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4888:5 › reactlynx3 tests › linear layout › config-css-default-display-linear-false

8) [chromium] › tests/react.spec.ts:4888:5 › reactlynx3 tests › linear layout › config-css-default-display-linear-false Error: expect(page).toHaveScreenshot(expected) failed 78600 pixels (ratio 0.28 of all image pixels) are different. Snapshot: config-css-default-display-linear-false//index.png Call log: - Expect "toHaveScreenshot(config-css-default-display-linear-false//index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 78600 pixels (ratio 0.28 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 78600 pixels (ratio 0.28 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4892:15

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4858:5 › reactlynx3 tests › linear layout › basic-linear-default-orientation

7) [chromium] › tests/react.spec.ts:4858:5 › reactlynx3 tests › linear layout › basic-linear-default-orientation Error: expect(page).toHaveScreenshot(expected) failed 7500 pixels (ratio 0.03 of all image pixels) are different. Snapshot: basic-linear-default-orientation/index/index.png Call log: - Expect "toHaveScreenshot(basic-linear-default-orientation/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 7500 pixels (ratio 0.03 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 7500 pixels (ratio 0.03 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4860:13

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4848:5 › reactlynx3 tests › linear layout › basic-linear-row-container-items-layout-gravity

6) [chromium] › tests/react.spec.ts:4848:5 › reactlynx3 tests › linear layout › basic-linear-row-container-items-layout-gravity Error: expect(page).toHaveScreenshot(expected) failed 24000 pixels (ratio 0.09 of all image pixels) are different. Snapshot: basic-linear-row-container-items-layout-gravity/index/index.png Call log: - Expect "toHaveScreenshot(basic-linear-row-container-items-layout-gravity/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 24000 pixels (ratio 0.09 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 24000 pixels (ratio 0.09 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4852:13

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4829:5 › reactlynx3 tests › linear layout › basic-linear-column-align-items

5) [chromium] › tests/react.spec.ts:4829:5 › reactlynx3 tests › linear layout › basic-linear-column-align-items Error: expect(page).toHaveScreenshot(expected) failed 52500 pixels (ratio 0.19 of all image pixels) are different. Snapshot: basic-linear-column-align-items/index/index.png Call log: - Expect "toHaveScreenshot(basic-linear-column-align-items/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 52500 pixels (ratio 0.19 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 52500 pixels (ratio 0.19 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4831:13

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4790:5 › reactlynx3 tests › linear layout › basic-linear-column-container-main-axis-graverty-start-end-with-direction-rtl

4) [chromium] › tests/react.spec.ts:4790:5 › reactlynx3 tests › linear layout › basic-linear-column-container-main-axis-graverty-start-end-with-direction-rtl Error: expect(page).toHaveScreenshot(expected) failed 88650 pixels (ratio 0.32 of all image pixels) are different. Snapshot: basic-linear-column-container-main-axis-graverty-start-end-with-direction-rtl/index/index.png Call log: - Expect "toHaveScreenshot(basic-linear-column-container-main-axis-graverty-start-end-with-direction-rtl/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 88650 pixels (ratio 0.32 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 88650 pixels (ratio 0.32 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4796:15

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4772:5 › reactlynx3 tests › linear layout › basic-linear-column-container-main-axis-graverty-top-bottom-with-direction-rtl

3) [chromium] › tests/react.spec.ts:4772:5 › reactlynx3 tests › linear layout › basic-linear-column-container-main-axis-graverty-top-bottom-with-direction-rtl Error: expect(page).toHaveScreenshot(expected) failed 88650 pixels (ratio 0.32 of all image pixels) are different. Snapshot: basic-linear-column-container-main-axis-graverty-top-bottom-with-direction-rtl/index/index.png Call log: - Expect "toHaveScreenshot(basic-linear-column-container-main-axis-graverty-top-bottom-with-direction-rtl/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 88650 pixels (ratio 0.32 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 88650 pixels (ratio 0.32 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4778:15

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (3/4) / check

[chromium] › tests/react.spec.ts:4754:5 › reactlynx3 tests › linear layout › basic-linear-row-container-main-axis-graverty-top-bottom-with-direction-rtl

2) [chromium] › tests/react.spec.ts:4754:5 › reactlynx3 tests › linear layout › basic-linear-row-container-main-axis-graverty-top-bottom-with-direction-rtl Error: expect(page).toHaveScreenshot(expected) failed 90000 pixels (ratio 0.32 of all image pixels) are different. Snapshot: basic-linear-row-container-main-axis-graverty-top-bottom-with-direction-rtl/index/index.png Call log: - Expect "toHaveScreenshot(basic-linear-row-container-main-axis-graverty-top-bottom-with-direction-rtl/index/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 90000 pixels (ratio 0.32 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 90000 pixels (ratio 0.32 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4760:15

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:3576:7 › reactlynx3 tests › elements › x-swiper › basic-element-x-swiper-mode-flat-coverflow

9) [webkit] › tests/react.spec.ts:3576:7 › reactlynx3 tests › elements › x-swiper › basic-element-x-swiper-mode-flat-coverflow Error: expect(page).toHaveScreenshot(expected) failed 58316 pixels (ratio 0.23 of all image pixels) are different. Snapshot: x-swiper/mode-flat-coverflow/index.png Call log: - Expect "toHaveScreenshot(x-swiper/mode-flat-coverflow/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 58316 pixels (ratio 0.23 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 58316 pixels (ratio 0.23 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:3581:17

Check failure on line 26 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:2337:7 › reactlynx3 tests › elements › text › basic-element-text-word-break

4) [webkit] › tests/react.spec.ts:2337:7 › reactlynx3 tests › elements › text › basic-element-text-word-break Error: expect(page).toHaveScreenshot(expected) failed 2762 pixels (ratio 0.02 of all image pixels) are different. Snapshot: text/word-break/index.png Call log: - Expect "toHaveScreenshot(text/word-break/index.png)" with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - waiting for fonts to load... - fonts loaded - 2762 pixels (ratio 0.02 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 2762 pixels (ratio 0.02 of all image pixels) are different. 24 | >[0], 25 | ) => { > 26 | await expect(page).toHaveScreenshot([ | ^ 27 | `${caseName}`, 28 | `${subcaseName}`, 29 | `${label}.png`, at diffScreenShot (/__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:26:22) at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:2339:15
`${caseName}`,
`${subcaseName}`,
`${label}.png`,
Expand Down Expand Up @@ -105,7 +105,7 @@
)
.filter(i => i.getAttribute('lynx-tag') === 'page').length
),
).toBe(1);

Check failure on line 108 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:93:5 › reactlynx3 tests › basic › basic-reload-page-only-one

2) [webkit] › tests/react.spec.ts:93:5 › reactlynx3 tests › basic › basic-reload-page-only-one ─── Error: expect(received).toBe(expected) // Object.is equality Expected: 1 Received: 0 106 | .filter(i => i.getAttribute('lynx-tag') === 'page').length 107 | ), > 108 | ).toBe(1); | ^ 109 | }); 110 | test('basic-bindtap', async ({ page }, { title }) => { 111 | await goto(page, title); at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:108:9
});
test('basic-bindtap', async ({ page }, { title }) => {
await goto(page, title);
Expand All @@ -118,6 +118,17 @@
await wait(100);
await expect(await target.getAttribute('style')).toContain('pink');
});
test('basic-bindtap-detail', async ({ page }, { title }) => {
await goto(page, title);
await wait(100);
const target = page.locator('#target');
await target.click();
await wait(100);
await expect(await target.getAttribute('style')).toContain('green');
await target.click();
await wait(100);
await expect(await target.getAttribute('style')).toContain('pink');
});
test('basic-event-target-id', async ({ page }, { title }) => {
await goto(page, title);
await wait(100);
Expand Down Expand Up @@ -841,7 +852,7 @@
'background-color',
'rgb(0, 128, 0)',
); // green
expect(page.locator('#target2'), 'mouse up event captured').toHaveCSS(

Check failure on line 855 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright ALL_ON_UI-CSR (2/4) / check

[chromium] › tests/react.spec.ts:842:5 › reactlynx3 tests › basic › basic-bindmouse

2) [chromium] › tests/react.spec.ts:842:5 › reactlynx3 tests › basic › basic-bindmouse ─────────── Error: mouse up event captured expect(locator).toHaveCSS(expected) failed Locator: locator('#target2') Expected: "rgb(0, 128, 0)" Received: "rgb(255, 192, 203)" Call log: - mouse up event captured with timeout 5000ms - waiting for locator('#target2') 2 × locator resolved to <x-view l-uid="5" id="target2" lynx-tag="view" l-p-comp-uid="1"></x-view> - unexpected value "rgb(255, 192, 203)" 853 | 'rgb(0, 128, 0)', 854 | ); // green > 855 | expect(page.locator('#target2'), 'mouse up event captured').toHaveCSS( | ^ 856 | 'background-color', 857 | 'rgb(0, 128, 0)', 858 | ); // green at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:855:69
'background-color',
'rgb(0, 128, 0)',
); // green
Expand Down Expand Up @@ -2292,7 +2303,7 @@
// nativeTextinitialtextinitial
// -- -> nativeText
count = await page.getByText('nativeText').count();
expect(count).toBe(1);

Check failure on line 2306 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:2291:7 › reactlynx3 tests › elements › text › basic-element-text-set-native-props-with-setData

3) [webkit] › tests/react.spec.ts:2291:7 › reactlynx3 tests › elements › text › basic-element-text-set-native-props-with-setData Error: expect(received).toBe(expected) // Object.is equality Expected: 1 Received: 0 2304 | // -- -> nativeText 2305 | count = await page.getByText('nativeText').count(); > 2306 | expect(count).toBe(1); | ^ 2307 | count = await page.getByText('initial').count(); 2308 | expect(count).toBeGreaterThanOrEqual(1); 2309 | count = await page.getByText('--').count(); at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:2306:25
count = await page.getByText('initial').count();
expect(count).toBeGreaterThanOrEqual(1);
count = await page.getByText('--').count();
Expand Down Expand Up @@ -2588,7 +2599,7 @@
)!.scrollTop = 200;
});
await wait(200);
const eventDetails = await page.evaluate(() => {

Check failure on line 2602 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:2589:7 › reactlynx3 tests › elements › scroll-view › basic-element-scroll-view-event-scrollend

5) [webkit] › tests/react.spec.ts:2589:7 › reactlynx3 tests › elements › scroll-view › basic-element-scroll-view-event-scrollend Error: page.evaluate: SyntaxError: JSON Parse error: Unexpected EOF 2600 | }); 2601 | await wait(200); > 2602 | const eventDetails = await page.evaluate(() => { | ^ 2603 | const event = JSON.parse( 2604 | document.querySelector('lynx-view')!.shadowRoot!.querySelector( 2605 | '#result>raw-text', at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:2602:43
const event = JSON.parse(
document.querySelector('lynx-view')!.shadowRoot!.querySelector(
'#result>raw-text',
Expand Down Expand Up @@ -2989,7 +3000,7 @@
await page.locator('input').press('Enter');
await wait(100);
const result = await page.locator('.result').first().innerText();
expect(result).toBe('bindconfirm');

Check failure on line 3003 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:2997:7 › reactlynx3 tests › elements › x-input › basic-element-x-input-bindconfirm

6) [webkit] › tests/react.spec.ts:2997:7 › reactlynx3 tests › elements › x-input › basic-element-x-input-bindconfirm Error: expect(received).toBe(expected) // Object.is equality Expected: "bindconfirm" Received: "" 3001 | await wait(100); 3002 | const result = await page.locator('.result').first().innerText(); > 3003 | expect(result).toBe('bindconfirm'); | ^ 3004 | }); 3005 | // input/bindconfirm test-case end 3006 | at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:3003:24
});
// input/bindconfirm test-case end

Expand Down Expand Up @@ -3048,7 +3059,7 @@
)?.click();
});
await wait(200);
expect(val).toBe(true);

Check failure on line 3062 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:3028:7 › reactlynx3 tests › elements › x-input › basic-element-x-input-getValue

7) [webkit] › tests/react.spec.ts:3028:7 › reactlynx3 tests › elements › x-input › basic-element-x-input-getValue Error: expect(received).toBe(expected) // Object.is equality Expected: true Received: false 3060 | }); 3061 | await wait(200); > 3062 | expect(val).toBe(true); | ^ 3063 | expect(selectionBegin).toBe(true); 3064 | expect(selectionEnd).toBe(true); 3065 | }, at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:3062:23
expect(selectionBegin).toBe(true);
expect(selectionEnd).toBe(true);
},
Expand All @@ -3065,7 +3076,7 @@
inputDom?.setSelectionRange(2, 5);
});
const result = await page.locator('.result').first().innerText();
expect(result).toBe('2-5');

Check failure on line 3079 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:3067:7 › reactlynx3 tests › elements › x-input › basic-element-x-input-bindselection

8) [webkit] › tests/react.spec.ts:3067:7 › reactlynx3 tests › elements › x-input › basic-element-x-input-bindselection Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: "2-5" Received: "" 3077 | }); 3078 | const result = await page.locator('.result').first().innerText(); > 3079 | expect(result).toBe('2-5'); | ^ 3080 | }, 3081 | ); 3082 | test( at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:3079:26

Check failure on line 3079 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (1/4) / check

[webkit] › tests/react.spec.ts:3067:7 › reactlynx3 tests › elements › x-input › basic-element-x-input-bindselection

8) [webkit] › tests/react.spec.ts:3067:7 › reactlynx3 tests › elements › x-input › basic-element-x-input-bindselection Error: expect(received).toBe(expected) // Object.is equality Expected: "2-5" Received: "" 3077 | }); 3078 | const result = await page.locator('.result').first().innerText(); > 3079 | expect(result).toBe('2-5'); | ^ 3080 | }, 3081 | ); 3082 | test( at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:3079:26
},
);
test(
Expand Down Expand Up @@ -4376,7 +4387,7 @@
await wait(100);
expect(bindblur).toBeTruthy();
expect(bindfocus).toBeTruthy();
expect(bindinput).toBeTruthy();

Check failure on line 4390 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (4/4) / check

[firefox] › tests/react.spec.ts:4338:7 › reactlynx3 tests › elements › x-textarea › basic-element-x-textarea-bindinput

2) [firefox] › tests/react.spec.ts:4338:7 › reactlynx3 tests › elements › x-textarea › basic-element-x-textarea-bindinput Retry #3 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBeTruthy() Received: false 4388 | expect(bindblur).toBeTruthy(); 4389 | expect(bindfocus).toBeTruthy(); > 4390 | expect(bindinput).toBeTruthy(); | ^ 4391 | }, 4392 | ); 4393 | // x-textarea/bindinput test-case end at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4390:29

Check failure on line 4390 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (4/4) / check

[firefox] › tests/react.spec.ts:4338:7 › reactlynx3 tests › elements › x-textarea › basic-element-x-textarea-bindinput

2) [firefox] › tests/react.spec.ts:4338:7 › reactlynx3 tests › elements › x-textarea › basic-element-x-textarea-bindinput Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBeTruthy() Received: false 4388 | expect(bindblur).toBeTruthy(); 4389 | expect(bindfocus).toBeTruthy(); > 4390 | expect(bindinput).toBeTruthy(); | ^ 4391 | }, 4392 | ); 4393 | // x-textarea/bindinput test-case end at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4390:29

Check failure on line 4390 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (4/4) / check

[firefox] › tests/react.spec.ts:4338:7 › reactlynx3 tests › elements › x-textarea › basic-element-x-textarea-bindinput

2) [firefox] › tests/react.spec.ts:4338:7 › reactlynx3 tests › elements › x-textarea › basic-element-x-textarea-bindinput Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBeTruthy() Received: false 4388 | expect(bindblur).toBeTruthy(); 4389 | expect(bindfocus).toBeTruthy(); > 4390 | expect(bindinput).toBeTruthy(); | ^ 4391 | }, 4392 | ); 4393 | // x-textarea/bindinput test-case end at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4390:29

Check failure on line 4390 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (4/4) / check

[firefox] › tests/react.spec.ts:4338:7 › reactlynx3 tests › elements › x-textarea › basic-element-x-textarea-bindinput

2) [firefox] › tests/react.spec.ts:4338:7 › reactlynx3 tests › elements › x-textarea › basic-element-x-textarea-bindinput Error: expect(received).toBeTruthy() Received: false 4388 | expect(bindblur).toBeTruthy(); 4389 | expect(bindfocus).toBeTruthy(); > 4390 | expect(bindinput).toBeTruthy(); | ^ 4391 | }, 4392 | ); 4393 | // x-textarea/bindinput test-case end at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4390:29
},
);
// x-textarea/bindinput test-case end
Expand Down Expand Up @@ -4557,7 +4568,7 @@
'basic-linear-orientation-horizontal-with-direction',
async ({ page }, {
title,
}) => {

Check failure on line 4571 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (4/4) / check

[firefox] › tests/react.spec.ts:4555:7 › reactlynx3 tests › elements › list › basic-element-list-estimated-main-axis-size-px-waterfall

3) [firefox] › tests/react.spec.ts:4555:7 › reactlynx3 tests › elements › list › basic-element-list-estimated-main-axis-size-px-waterfall Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBeTruthy() Received: false 4569 | await goto(page, title); 4570 | await wait(5000); > 4571 | expect(scrolltolower).toBeTruthy(); | ^ 4572 | }, 4573 | ); 4574 | test( at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4571:33

Check failure on line 4571 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright MULTI_THREAD-CSR (4/4) / check

[firefox] › tests/react.spec.ts:4555:7 › reactlynx3 tests › elements › list › basic-element-list-estimated-main-axis-size-px-waterfall

3) [firefox] › tests/react.spec.ts:4555:7 › reactlynx3 tests › elements › list › basic-element-list-estimated-main-axis-size-px-waterfall Error: expect(received).toBeTruthy() Received: false 4569 | await goto(page, title); 4570 | await wait(5000); > 4571 | expect(scrolltolower).toBeTruthy(); | ^ 4572 | }, 4573 | ); 4574 | test( at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4571:33

Check failure on line 4571 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright ALL_ON_UI-CSR (2/4) / check

[chromium] › tests/react.spec.ts:4555:7 › reactlynx3 tests › elements › list › basic-element-list-estimated-main-axis-size-px-waterfall

3) [chromium] › tests/react.spec.ts:4555:7 › reactlynx3 tests › elements › list › basic-element-list-estimated-main-axis-size-px-waterfall Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBeTruthy() Received: false 4569 | await goto(page, title); 4570 | await wait(5000); > 4571 | expect(scrolltolower).toBeTruthy(); | ^ 4572 | }, 4573 | ); 4574 | test( at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4571:33

Check failure on line 4571 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright ALL_ON_UI-CSR (2/4) / check

[chromium] › tests/react.spec.ts:4555:7 › reactlynx3 tests › elements › list › basic-element-list-estimated-main-axis-size-px-waterfall

3) [chromium] › tests/react.spec.ts:4555:7 › reactlynx3 tests › elements › list › basic-element-list-estimated-main-axis-size-px-waterfall Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBeTruthy() Received: false 4569 | await goto(page, title); 4570 | await wait(5000); > 4571 | expect(scrolltolower).toBeTruthy(); | ^ 4572 | }, 4573 | ); 4574 | test( at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4571:33

Check failure on line 4571 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright ALL_ON_UI-CSR (2/4) / check

[chromium] › tests/react.spec.ts:4555:7 › reactlynx3 tests › elements › list › basic-element-list-estimated-main-axis-size-px-waterfall

3) [chromium] › tests/react.spec.ts:4555:7 › reactlynx3 tests › elements › list › basic-element-list-estimated-main-axis-size-px-waterfall Error: expect(received).toBeTruthy() Received: false 4569 | await goto(page, title); 4570 | await wait(5000); > 4571 | expect(scrolltolower).toBeTruthy(); | ^ 4572 | }, 4573 | ); 4574 | test( at /__w/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:4571:33
await goto(page, title);
await diffScreenShot(page, title, 'index');
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2023 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
import { useState, root } from '@lynx-js/react';
function App() {
const [color, setColor] = useState('pink');
const handleTap = (e) => {
if (typeof e.detail.x === 'number' && typeof e.detail.y === 'number') {
setColor(color === 'pink' ? 'green' : 'pink');
}
};

return (
<view
id='target'
bindtap={handleTap}
style={{
height: '100px',
width: '100px',
background: color,
}}
/>
);
}
root.render(<App />);
Loading