Skip to content

Commit 4eacd1f

Browse files
authored
Fixed focused link bg color (DevExpress#29680) (DevExpress#29692)
1 parent ab5abe3 commit 4eacd1f

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/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
@@ -985,14 +985,17 @@ $fluent-grid-base-group-panel-message-line-height: $fluent-button-text-line-heig
985985
&.dx-data-row {
986986
& > td:not(.dx-focused):not(.dx-cell-modified):not(.dx-#{$widget-name}-invalid),
987987
& .dx-command-edit .dx-link {
988-
background-color: $datagrid-row-focused-bg;
989988
color: $datagrid-row-focused-color;
990989

991990
& .dx-#{$widget-name}-group-opened,
992991
& .dx-#{$widget-name}-group-closed {
993992
color: $datagrid-row-focused-color;
994993
}
995994
}
995+
996+
& > td:not(.dx-focused):not(.dx-cell-modified):not(.dx-#{$widget-name}-invalid) {
997+
background-color: $datagrid-row-focused-bg;
998+
}
996999
}
9971000

9981001
&: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
@@ -774,7 +774,6 @@ $generic-grid-base-group-panel-message-line-height: $generic-button-text-line-he
774774
& > td:not(.dx-focused),
775775
& > tr > td:not(.dx-focused),
776776
& .dx-command-edit:not(.dx-focused) .dx-link {
777-
background-color: $datagrid-row-focused-bg;
778777
color: $datagrid-row-focused-color;
779778

780779
.dx-texteditor-input {
@@ -787,6 +786,11 @@ $generic-grid-base-group-panel-message-line-height: $generic-button-text-line-he
787786
}
788787
}
789788

789+
& > td:not(.dx-focused),
790+
& > tr > td:not(.dx-focused) {
791+
background-color: $datagrid-row-focused-bg;
792+
}
793+
790794
& .dx-command-edit .dx-link:focus {
791795
background-color: $datagrid-base-background-color;
792796
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
@@ -950,7 +950,6 @@ $material-grid-base-group-panel-message-line-height: $material-button-text-line-
950950
&.dx-data-row {
951951
& > td:not(.dx-focused):not(.dx-cell-modified):not(.dx-#{$widget-name}-invalid),
952952
& .dx-command-edit .dx-link {
953-
background-color: $datagrid-row-focused-bg;
954953
color: $datagrid-row-focused-color;
955954

956955
& .dx-#{$widget-name}-group-opened,
@@ -959,6 +958,10 @@ $material-grid-base-group-panel-message-line-height: $material-button-text-line-
959958
}
960959
}
961960

961+
& > td:not(.dx-focused):not(.dx-cell-modified):not(.dx-#{$widget-name}-invalid) {
962+
background-color: $datagrid-row-focused-bg;
963+
}
964+
962965
& .dx-command-edit .dx-link:focus {
963966
background-color: $datagrid-base-background-color;
964967
color: $datagrid-link-color;

0 commit comments

Comments
 (0)