Skip to content

Commit

Permalink
TabPanel: support focused but not selected state in Generic
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeniyKiyashko committed Sep 4, 2024
1 parent 536fcb8 commit c341d14
Show file tree
Hide file tree
Showing 31 changed files with 509 additions and 444 deletions.
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.
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.
62 changes: 61 additions & 1 deletion e2e/testcafe-devextreme/tests/navigation/tabPanel/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,6 @@ test('TabPanel borders without scrolling', async (t) => {

await t.dispatchEvent(firstItem.element, 'mousedown');
await testScreenshot(t, takeScreenshot, `TabPanel 1 item active,tabsPosition=${tabsPosition}.png`, { element: '#container' });

// TODO: this test is unstable
// await t
// .dispatchEvent(thirdItem.element, 'mouseup')
Expand Down Expand Up @@ -533,6 +532,67 @@ test('TabPanel borders without scrolling', async (t) => {

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

test(`TabPanel tabs selected item focus with tabsPosition=${tabsPosition}`, async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

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

await t.click(tabPanel.multiView.element);
await testScreenshot(t, takeScreenshot, `TabPanel item focus when clicking on multiview,tabsPosition=${tabsPosition}.png`, { element: '#container' });

await t.pressKey('right');
await testScreenshot(t, takeScreenshot, `TabPanel disabled item focused,tabsPosition=${tabsPosition}.png`, { element: '#container' });

await t.click(tabPanel.multiView.element);

await t.pressKey('left');
await testScreenshot(t, takeScreenshot, `TabPanel focus not selected item,tabsPosition=${tabsPosition}.png`, { element: '#container' });

await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => {
await ClientFunction(() => {
(window as any).DevExpress.ui.dxTabs.defaultOptions({
options: {
useInkRipple: false,
},
});
})();

const dataSource = [
{
title: 'John Heart',
text: 'John Heart',
}, {
title: 'Olivia Peyton',
text: 'Olivia Peyton',
}, {
title: 'Robert Reagan',
text: 'Robert Reagan',
disabled: true,
}, {
title: 'Greta Sims',
text: 'Greta Sims',
}, {
title: 'Olivia Peyton',
text: 'Olivia Peyton',
},
] as Item[];

const tabPanelOptions = {
dataSource,
height: 250,
width: 450,
tabsPosition,
selectedIndex: 1,
// prevent firing dxinactive event for to avoid failing test
itemHoldTimeout: 5000,
};

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

[true, false].forEach((rtlEnabled) => {
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.
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.
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.
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.
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.
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.
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.
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.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
border: $generic-tabs-border;
}

&.dx-state-focused {
.dx-multiview-wrapper.dx-state-focused {
border-color: $tabs-focused-border-color;
}
}
// &.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 @@ -39,25 +39,25 @@
}
}

&.dx-state-focused {
&.dx-disabled-focused-tab {
.dx-tabs-wrapper {
border-block-start: $generic-tabs-border;
}
// &.dx-state-focused {
// &.dx-disabled-focused-tab {
// .dx-tabs-wrapper {
// border-block-start: $generic-tabs-border;
// }

.dx-tabs-nav-button {
border-block-start: $generic-tabs-border;
}
}
// .dx-tabs-nav-button {
// border-block-start: $generic-tabs-border;
// }
// }

.dx-tabs-wrapper {
border-block-start: $generic-tabs-border-focus;
}
// .dx-tabs-wrapper {
// border-block-start: $generic-tabs-border-focus;
// }

.dx-tabs-nav-button {
border-block-start: $generic-tabs-border-focus;
}
}
// .dx-tabs-nav-button {
// border-block-start: $generic-tabs-border-focus;
// }
// }

&:not(.dx-empty-collection) {
.dx-multiview-wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
border-inline-start: $generic-tabs-border;
border-inline-end: $generic-tabs-border;

@include dx-tabs-border-mixin(
$generic-tabs-border,
none,
$generic-tabs-border,
none,
);
// @include dx-tabs-border-mixin(
// $generic-tabs-border,
// none,
// $generic-tabs-border,
// none,
// );
}

.dx-tabs .dx-tabs-scrollable {
Expand All @@ -39,25 +39,25 @@
}
}

&.dx-state-focused {
&.dx-disabled-focused-tab {
.dx-tabs-wrapper {
border-inline-end: $generic-tabs-border;
}
// &.dx-state-focused {
// &.dx-disabled-focused-tab {
// .dx-tabs-wrapper {
// border-inline-end: $generic-tabs-border;
// }

.dx-tabs-nav-button {
border-inline-end: $generic-tabs-border;
}
}
// .dx-tabs-nav-button {
// border-inline-end: $generic-tabs-border;
// }
// }

.dx-tabs-wrapper {
border-inline-end: $generic-tabs-border-focus;
}
// .dx-tabs-wrapper {
// border-inline-end: $generic-tabs-border-focus;
// }

.dx-tabs-nav-button {
border-inline-end: $generic-tabs-border-focus;
}
}
// .dx-tabs-nav-button {
// border-inline-end: $generic-tabs-border-focus;
// }
// }

&:not(.dx-empty-collection) {
.dx-multiview-wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
border-inline-start: $generic-tabs-border;
border-inline-end: $generic-tabs-border;

@include dx-tabs-border-mixin(
$generic-tabs-border,
none,
$generic-tabs-border,
none,
);
// @include dx-tabs-border-mixin(
// $generic-tabs-border,
// none,
// $generic-tabs-border,
// none,
// );
}

.dx-tabs .dx-tabs-scrollable {
Expand All @@ -39,25 +39,25 @@
}
}

&.dx-state-focused {
&.dx-disabled-focused-tab {
.dx-tabs-wrapper {
border-inline-start: $generic-tabs-border;
}
// &.dx-state-focused {
// &.dx-disabled-focused-tab {
// .dx-tabs-wrapper {
// border-inline-start: $generic-tabs-border;
// }

.dx-tabs-nav-button {
border-inline-start: $generic-tabs-border;
}
}
// .dx-tabs-nav-button {
// border-inline-start: $generic-tabs-border;
// }
// }

.dx-tabs-wrapper {
border-inline-start: $generic-tabs-border-focus;
}
// .dx-tabs-wrapper {
// border-inline-start: $generic-tabs-border-focus;
// }

.dx-tabs-nav-button {
border-inline-start: $generic-tabs-border-focus;
}
}
// .dx-tabs-nav-button {
// border-inline-start: $generic-tabs-border-focus;
// }
// }

&:not(.dx-empty-collection) {
.dx-multiview-wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,25 @@
}
}

&.dx-state-focused {
&.dx-disabled-focused-tab {
.dx-tabs-wrapper {
border-block-end: $generic-tabs-border;
}
// &.dx-state-focused {
// &.dx-disabled-focused-tab {
// .dx-tabs-wrapper {
// border-block-end: $generic-tabs-border;
// }

.dx-tabs-nav-button {
border-block-end: $generic-tabs-border;
}
}
// .dx-tabs-nav-button {
// border-block-end: $generic-tabs-border;
// }
// }

.dx-tabs-wrapper {
border-block-end: $generic-tabs-border-focus;
}
// .dx-tabs-wrapper {
// border-block-end: $generic-tabs-border-focus;
// }

.dx-tabs-nav-button {
border-block-end: $generic-tabs-border-focus;
}
}
// .dx-tabs-nav-button {
// border-block-end: $generic-tabs-border-focus;
// }
// }

&:not(.dx-empty-collection) {
.dx-multiview-wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
.dx-tabpanel-tab {
padding: $generic-tabpanel-tabs-item-padding;

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

&.dx-state-disabled {
&::after {
Expand Down
Loading

0 comments on commit c341d14

Please sign in to comment.