Skip to content

Commit

Permalink
TabPanel: Fix incorrect focus borders in Generic (T1191269)
Browse files Browse the repository at this point in the history
  • Loading branch information
marker-dao authored Sep 28, 2023
1 parent bbb1b13 commit ac1c821
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,14 @@
content: none;
}
}

.dx-multiview-wrapper {
border: $generic-tabs-border;
}

&.dx-state-focused {
.dx-multiview-wrapper.dx-state-focused {
border-color: $tabs-focused-border-color;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,4 @@
border-block-end: none;
}
}

.dx-multiview-wrapper {
border: $generic-tabs-border;

&.dx-state-focused {
border-color: $tabs-focused-border-color;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,4 @@
border-inline-start: none;
}
}

.dx-multiview-wrapper {
border: $generic-tabs-border;

&.dx-state-focused {
border-color: $tabs-focused-border-color;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,4 @@
border-inline-end: none;
}
}

.dx-multiview-wrapper {
border: $generic-tabs-border;

&.dx-state-focused {
border-color: $tabs-focused-border-color;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,4 @@
border-block-start: none;
}
}

.dx-multiview-wrapper {
border: $generic-tabs-border;

&.dx-state-focused {
border-color: $tabs-focused-border-color;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
.dx-tabpanel-tab {
padding: $generic-tabpanel-tabs-item-padding;

&.dx-state-focused::after {
border-color: $tabs-border-color;
}

&.dx-state-disabled {
&::after {
z-index: 3;
Expand All @@ -41,6 +45,14 @@

.dx-tabpanel.dx-state-focused {
.dx-tabpanel-tab {
&.dx-state-focused::after {
border-color: $tabs-focused-border-color;
}

&.dx-state-focused.dx-state-disabled::after {
border-color: $tabs-focused-disabled-border-color;
}

&.dx-focused-disabled-next-tab {
&::after {
border-inline-end: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,47 @@ test('TabPanel borders with scrolling', async (t) => {
return createWidget('dxTabPanel', tabPanelOptions);
});

test('TabPanel focus borders after change selectedIndex in runtime', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const tabPanel = new TabPanel('#container');

await tabPanel.option({ selectedIndex: 1 } as any);

await testScreenshot(t, takeScreenshot, 'TabPanel focus borders.png', { element: '#container' });

await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => {
const dataSource = [
{
title: 'John Heart',
text: 'John Heart',
}, {
title: 'Olivia Peyton',
text: 'Olivia Peyton',
}, {
title: 'Robert Reagan',
text: 'Robert Reagan',
}, {
title: 'Greta Sims',
text: 'Greta Sims',
}, {
title: 'Olivia Peyton',
text: 'Olivia Peyton',
},
] as Item[];

const tabPanelOptions = {
dataSource,
height: 120,
width: 300,
};

return createWidget('dxTabPanel', tabPanelOptions);
});

test('TabPanel borders without scrolling', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ac1c821

Please sign in to comment.