fix focus scroll layering
This commit is contained in:
1 parent
758c300d9e
commit
d2a935b6c1
6 files changed
+23
-16
No files matched your search
@@ -35,7 +35,7 @@
|
|||||||
.surfaceHostAdvanced {
|
.surfaceHostAdvanced {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
z-index: calc(var(--mantine-z-index-popover) - 1);
|
z-index: calc(var(--mantine-z-index-modal) - 1);
|
||||||
width: auto;
|
width: auto;
|
||||||
height: auto;
|
height: auto;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ export const BoardAdvancedFocusProvider = ({ children }: PropsWithChildren) => {
|
|||||||
data-advanced-focus-overlay
|
data-advanced-focus-overlay
|
||||||
backgroundOpacity={0.38}
|
backgroundOpacity={0.38}
|
||||||
blur={0}
|
blur={0}
|
||||||
zIndex="calc(var(--mantine-z-index-popover) - 2)"
|
zIndex="calc(var(--mantine-z-index-modal) - 2)"
|
||||||
className={`${classes.backdrop} ${active.phase === "closing" ? classes.backdropClosing : ""}`}
|
className={`${classes.backdrop} ${active.phase === "closing" ? classes.backdropClosing : ""}`}
|
||||||
aria-hidden
|
aria-hidden
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -120,13 +120,30 @@ describe("Board advanced interactions", () => {
|
|||||||
probe.dataset.shiftScrollProbe = "true";
|
probe.dataset.shiftScrollProbe = "true";
|
||||||
probe.style.cssText = "height:80px;overflow-y:auto";
|
probe.style.cssText = "height:80px;overflow-y:auto";
|
||||||
probe.innerHTML = '<div style="height:600px"></div>';
|
probe.innerHTML = '<div style="height:600px"></div>';
|
||||||
|
probe.addEventListener("wheel", (event) => event.stopPropagation());
|
||||||
element.append(probe);
|
element.append(probe);
|
||||||
});
|
});
|
||||||
const scrollProbe = advancedSurface.locator("[data-shift-scroll-probe]");
|
const scrollProbe = advancedSurface.locator("[data-shift-scroll-probe]");
|
||||||
await page.keyboard.down("Shift");
|
await page.keyboard.down("Shift");
|
||||||
await scrollProbe.dispatchEvent("wheel", { shiftKey: true, deltaX: 120, deltaY: 0 });
|
const pixelEventCancelled = await scrollProbe.evaluate(
|
||||||
|
(element) =>
|
||||||
|
!element.dispatchEvent(
|
||||||
|
new WheelEvent("wheel", { bubbles: true, cancelable: true, shiftKey: true, deltaX: 120 }),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(pixelEventCancelled).toBe(true);
|
||||||
|
await scrollProbe.evaluate((element) => {
|
||||||
|
element.scrollTop = 0;
|
||||||
|
});
|
||||||
|
const lineEventCancelled = await scrollProbe.evaluate(
|
||||||
|
(element) =>
|
||||||
|
!element.dispatchEvent(
|
||||||
|
new WheelEvent("wheel", { bubbles: true, cancelable: true, shiftKey: true, deltaX: 3, deltaMode: 1 }),
|
||||||
|
),
|
||||||
|
);
|
||||||
await page.keyboard.up("Shift");
|
await page.keyboard.up("Shift");
|
||||||
expect(await scrollProbe.evaluate((element) => element.scrollTop)).toBeGreaterThan(0);
|
expect(lineEventCancelled).toBe(true);
|
||||||
|
expect(await scrollProbe.evaluate((element) => element.scrollTop)).toBeGreaterThanOrEqual(48);
|
||||||
await page.keyboard.press("Escape");
|
await page.keyboard.press("Escape");
|
||||||
await expect(advancedSurface).toBeHidden();
|
await expect(advancedSurface).toBeHidden();
|
||||||
await expect(widget).toBeFocused();
|
await expect(widget).toBeFocused();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export interface StreamSession {
|
export interface StreamSession {
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
sessionName: string;
|
sessionName: string;
|
||||||
user?: {
|
user: {
|
||||||
userId: string;
|
userId: string;
|
||||||
username: string;
|
username: string;
|
||||||
profilePictureUrl: string | null;
|
profilePictureUrl: string | null;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export const DiskUsage = ({ system, fontSize, progressSize, valueMiw, valueGap =
|
|||||||
{formatPercent(system.disk)}
|
{formatPercent(system.disk)}
|
||||||
</Text>
|
</Text>
|
||||||
<HoverCard
|
<HoverCard
|
||||||
zIndex={getDefaultZIndex("popover") - 3}
|
zIndex={getDefaultZIndex("modal") - 3}
|
||||||
position="right"
|
position="right"
|
||||||
withArrow
|
withArrow
|
||||||
shadow="md"
|
shadow="md"
|
||||||
|
|||||||
@@ -42,16 +42,6 @@ describe("getWidgetQueryKeys", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("supportsAdvancedFocus", () => {
|
describe("supportsAdvancedFocus", () => {
|
||||||
const definition = { supportsAdvancedFocus: undefined } as Parameters<typeof supportsAdvancedFocus>[0];
|
|
||||||
|
|
||||||
test("defaults to enabled", () => {
|
|
||||||
expect(supportsAdvancedFocus(definition)).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
test("allows widgets to opt out", () => {
|
|
||||||
expect(supportsAdvancedFocus({ ...definition, supportsAdvancedFocus: false })).toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
test.each([appDefinition, beszelSystemGridDefinition, beszelSystemTableDefinition])(
|
test.each([appDefinition, beszelSystemGridDefinition, beszelSystemTableDefinition])(
|
||||||
"keeps non-enhanced widgets compact",
|
"keeps non-enhanced widgets compact",
|
||||||
(widgetDefinition) => {
|
(widgetDefinition) => {
|
||||||
|
|||||||
Reference in new issue
Block a user