Skip to content

Commit 34debb1

Browse files
authored
Fixed focused link bg color (DevExpress#29680) (DevExpress#29693)
1 parent 4c5825a commit 34debb1

File tree

7 files changed

+53
-3
lines changed

7 files changed

+53
-3
lines changed
7.99 KB
Loading
7.56 KB
Loading
7.02 KB
Loading

e2e/testcafe-devextreme/tests/dataGrid/common/focus/focusedRow/markup.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { changeTheme } from '../../../../../helpers/changeTheme';
44
import { createWidget } from '../../../../../helpers/createWidget';
55
import url from '../../../../../helpers/getPageUrl';
66
import { Themes } from '../../../../../helpers/themes';
7+
import { insertStylesheetRulesToPage, removeStylesheetRulesFromPage } from '../../../../../helpers/domUtils';
78

89
fixture.disablePageReloads`Focused row - markup`
910
.page(url(__dirname, '../../../../container.html'));
@@ -106,3 +107,42 @@ fixture.disablePageReloads`Focused row - markup`
106107
});
107108
}).after(async () => changeTheme(Themes.genericLight));
108109
});
110+
111+
[
112+
Themes.materialBlue,
113+
Themes.genericLight,
114+
Themes.fluentBlue,
115+
].forEach((theme) => {
116+
test(`Link should not have background color in ${theme} (T1282624)`, async (t) => {
117+
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
118+
const dataGrid = new DataGrid('#container');
119+
120+
// assert
121+
await takeScreenshot(`focused-row-link-background (${theme}).png`, dataGrid.element);
122+
await t
123+
.expect(compareResults.isValid())
124+
.ok(compareResults.errorMessages());
125+
}).before(async () => {
126+
await changeTheme(theme);
127+
128+
await insertStylesheetRulesToPage('#container tr.dx-row-focused td { background-color: red }');
129+
130+
await createWidget('dxDataGrid', {
131+
dataSource: [
132+
{ id: 0, text: 'text_1' },
133+
{ id: 1, text: 'text_2' },
134+
{ id: 2, text: 'text_3' },
135+
],
136+
focusedRowEnabled: true,
137+
editing: {
138+
allowDeleting: true,
139+
useIcons: false,
140+
},
141+
focusedRowKey: 1,
142+
keyExpr: 'id',
143+
});
144+
}).after(async () => {
145+
await changeTheme(Themes.genericLight);
146+
await removeStylesheetRulesFromPage();
147+
});
148+
});

packages/devextreme-scss/scss/widgets/fluent/gridBase/_index.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,14 +1039,17 @@ $fluent-grid-base-group-panel-message-line-height: $fluent-button-text-line-heig
10391039
&.dx-data-row {
10401040
& > td:not(.dx-focused):not(.dx-cell-modified):not(.dx-#{$widget-name}-invalid),
10411041
& .dx-command-edit .dx-link {
1042-
background-color: $datagrid-row-focused-bg;
10431042
color: $datagrid-row-focused-color;
10441043

10451044
& .dx-#{$widget-name}-group-opened,
10461045
& .dx-#{$widget-name}-group-closed {
10471046
color: $datagrid-row-focused-color;
10481047
}
10491048
}
1049+
1050+
& > td:not(.dx-focused):not(.dx-cell-modified):not(.dx-#{$widget-name}-invalid) {
1051+
background-color: $datagrid-row-focused-bg;
1052+
}
10501053
}
10511054

10521055
&:not(.dx-row-lines) {

packages/devextreme-scss/scss/widgets/generic/gridBase/_index.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,6 @@ $generic-grid-base-cell-input-height: round($generic-base-line-height * $generic
806806
& > td:not(.dx-focused),
807807
& > tr > td:not(.dx-focused),
808808
& .dx-command-edit:not(.dx-focused) .dx-link {
809-
background-color: $datagrid-row-focused-bg;
810809
color: $datagrid-row-focused-color;
811810

812811
.dx-texteditor-input {
@@ -819,6 +818,11 @@ $generic-grid-base-cell-input-height: round($generic-base-line-height * $generic
819818
}
820819
}
821820

821+
& > td:not(.dx-focused),
822+
& > tr > td:not(.dx-focused) {
823+
background-color: $datagrid-row-focused-bg;
824+
}
825+
822826
& .dx-command-edit .dx-link:focus {
823827
background-color: $datagrid-base-background-color;
824828
color: $datagrid-base-color;

packages/devextreme-scss/scss/widgets/material/gridBase/_index.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,6 @@ $material-grid-base-group-panel-message-line-height: $material-button-text-line-
10041004
&.dx-data-row {
10051005
& > td:not(.dx-focused):not(.dx-cell-modified):not(.dx-#{$widget-name}-invalid),
10061006
& .dx-command-edit .dx-link {
1007-
background-color: $datagrid-row-focused-bg;
10081007
color: $datagrid-row-focused-color;
10091008

10101009
& .dx-#{$widget-name}-group-opened,
@@ -1013,6 +1012,10 @@ $material-grid-base-group-panel-message-line-height: $material-button-text-line-
10131012
}
10141013
}
10151014

1015+
& > td:not(.dx-focused):not(.dx-cell-modified):not(.dx-#{$widget-name}-invalid) {
1016+
background-color: $datagrid-row-focused-bg;
1017+
}
1018+
10161019
& .dx-command-edit .dx-link:focus {
10171020
background-color: $datagrid-base-background-color;
10181021
color: $datagrid-link-color;

0 commit comments

Comments
 (0)