Sync dock touch interaction fix
This commit is contained in:
parent
4e662cd2f9
commit
c80dee98a7
@ -364,8 +364,10 @@ window.addEventListener('airship:dock-hide', () => hide());
|
|||||||
window.addEventListener('airship:dock-close', () => hide());
|
window.addEventListener('airship:dock-close', () => hide());
|
||||||
window.addEventListener('airship:dock-return', (event) => show(event.detail || latestState));
|
window.addEventListener('airship:dock-return', (event) => show(event.detail || latestState));
|
||||||
window.addEventListener('airship:hud-state', (event) => {
|
window.addEventListener('airship:hud-state', (event) => {
|
||||||
|
// Keep the latest snapshot for fallback/return, but do not rebuild interactive
|
||||||
|
// dock lists every frame. Replacing buttons between pointerdown and click
|
||||||
|
// breaks touch interaction on mobile.
|
||||||
latestState = event.detail;
|
latestState = event.detail;
|
||||||
if (!overlay.hidden) render(event.detail);
|
|
||||||
});
|
});
|
||||||
window.addEventListener('keydown', (event) => {
|
window.addEventListener('keydown', (event) => {
|
||||||
if (event.key === 'Escape' && !overlay.hidden) dispatchAction('close-dock');
|
if (event.key === 'Escape' && !overlay.hidden) dispatchAction('close-dock');
|
||||||
|
|||||||
@ -337,6 +337,12 @@ test('dock trade and missions are driven by generated port economy state', async
|
|||||||
assert.match(dockUi, /sell-trade-good/);
|
assert.match(dockUi, /sell-trade-good/);
|
||||||
assert.match(dockUi, /accept-mission/);
|
assert.match(dockUi, /accept-mission/);
|
||||||
assert.match(dockUi, /complete-mission/);
|
assert.match(dockUi, /complete-mission/);
|
||||||
|
assert.match(dockUi, /airship:dock-state/);
|
||||||
|
assert.match(dockUi, /latestState = event\.detail/);
|
||||||
|
assert.doesNotMatch(
|
||||||
|
dockUi,
|
||||||
|
/airship:hud-state'[\s\S]{0,180}if \(!overlay\.hidden\) render\(event\.detail\)/,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('mobile merchant traffic uses a reduced render budget', async () => {
|
test('mobile merchant traffic uses a reduced render budget', async () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user