Skip to content

Commit

Permalink
Fixed #7596 - Dynamic panel has wrong focus for tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
tsv2013 committed Dec 28, 2023
1 parent f095bce commit 010743a
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 25 deletions.
4 changes: 3 additions & 1 deletion src/defaultV2-theme/blocks/sd-paneldynamic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@
overflow-x: hidden;
white-space: nowrap;

&:hover {
&:hover,
&:focus-visible {
outline: none;
box-shadow: inset 0px -2px 0px $primary;
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 55 additions & 24 deletions visualRegressionTests/tests/defaultV2/paneldynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ const theme = "defaultV2";
frameworks.forEach(framework => {
fixture`${framework} ${title} ${theme}`
.page`${url_test}${theme}/${framework}`.beforeEach(async t => {
await applyTheme(theme);
await initSurvey(framework, json);
});
await applyTheme(theme);
await initSurvey(framework, json);
});
test("Paneldynamic progressTop mode", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {

Expand Down Expand Up @@ -95,16 +95,16 @@ frameworks.forEach(framework => {
frameworks.forEach(framework => {
fixture`${framework} ${title} ${theme}`
.page`${url_test}${theme}/${framework}`.beforeEach(async t => {
await applyTheme(theme);
await initSurvey(framework, json, {
onGetPanelFooterActions: (_, opt) => {
opt.actions.push({
title: "Duplicate",
action: () => { }
});
}
await applyTheme(theme);
await initSurvey(framework, json, {
onGetPanelFooterActions: (_, opt) => {
opt.actions.push({
title: "Duplicate",
action: () => { }
});
}
});
});
});
test("Check paneldynamic with custom actions", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1920, 1080);
Expand Down Expand Up @@ -153,9 +153,9 @@ frameworks.forEach(framework => {
};
fixture`${framework} ${title} ${theme}`
.page`${url_test}${theme}/${framework}`.beforeEach(async t => {
await applyTheme(theme);
await initSurvey(framework, json);
});
await applyTheme(theme);
await initSurvey(framework, json);
});
test("Two Paneldynamics in one row", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1920, 1920);
Expand Down Expand Up @@ -260,9 +260,9 @@ frameworks.forEach(framework => {
};
fixture`${framework} ${title} ${theme}`
.page`${url_test}${theme}/${framework}`.beforeEach(async t => {
await applyTheme(theme);
await initSurvey(framework, json);
});
await applyTheme(theme);
await initSurvey(framework, json);
});
test("Navigation panel by tabs", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1280, 900);
Expand Down Expand Up @@ -379,9 +379,9 @@ frameworks.forEach(framework => {
};
fixture`${framework} ${title} ${theme}`
.page`${url_test}${theme}/${framework}`.beforeEach(async t => {
await applyTheme(theme);
await initSurvey(framework, json);
});
await applyTheme(theme);
await initSurvey(framework, json);
});
test("Paneldynamic without buttons", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1280, 900);
Expand Down Expand Up @@ -416,9 +416,9 @@ frameworks.forEach(framework => {
};
fixture`${framework} ${title} ${theme}`
.page`${url_test}${theme}/${framework}`.beforeEach(async t => {
await applyTheme(theme);
await initSurvey(framework, json);
});
await applyTheme(theme);
await initSurvey(framework, json);
});
test("Paneldynamic confirm dialog", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1280, 900);
Expand All @@ -427,4 +427,35 @@ frameworks.forEach(framework => {
await takeElementScreenshot("paneldynamic-confirm-dialog", Selector(".sv-popup--confirm-delete .sv-popup__body-content"), t, comparer);
});
});
test("tab focused state for panel dynamic", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1280, 900);
await initSurvey(framework, {
"pages": [
{
"name": "page1",
"elements": [
{
"type": "paneldynamic",
"name": "question1",
"templateElements": [
{
"type": "text",
"name": "question2"
}
],
"panelCount": 4,
"minPanelCount": 4,
"renderMode": "tab"
}
]
}
]
});
await t
.click(Selector("button[title='Panel 1']"))
.pressKey("tab");
await takeElementScreenshot("paneldynamic-focused-tab", Selector(".sd-question--paneldynamic"), t, comparer);
});
});
});

0 comments on commit 010743a

Please sign in to comment.