Skip to content

Commit 709dfd1

Browse files
authored
List: Revert styles for .dx-button .dx-icon in Generic (T1216108)
1 parent fb7f313 commit 709dfd1

8 files changed

+60
-5
lines changed

packages/devextreme/scss/widgets/generic/list/_index.scss

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ $generic-list-search-editor-height: round($generic-base-line-height * $generic-b
6060
background-color: $list-item-hover-bg;
6161
color: $list-item-hover-color;
6262

63-
.dx-icon {
63+
.dx-list-item-icon-container .dx-icon {
6464
color: $list-item-hover-color;
6565
}
6666

@@ -71,7 +71,7 @@ $generic-list-search-editor-height: round($generic-base-line-height * $generic-b
7171
background-color: $list-item-selected-bg;
7272
color: $list-item-selected-color;
7373

74-
.dx-icon {
74+
.dx-list-item-icon-container .dx-icon {
7575
color: $list-item-selected-color;
7676
}
7777

@@ -87,7 +87,7 @@ $generic-list-search-editor-height: round($generic-base-line-height * $generic-b
8787
background-color: $list-focused-bg;
8888
color: $list-item-focus-color;
8989

90-
.dx-icon {
90+
.dx-list-item-icon-container .dx-icon {
9191
color: $list-item-focus-color;
9292
}
9393

@@ -107,7 +107,7 @@ $generic-list-search-editor-height: round($generic-base-line-height * $generic-b
107107
background-color: $list-item-active-bg;
108108
color: $list-item-active-color;
109109

110-
.dx-icon {
110+
.dx-list-item-icon-container .dx-icon {
111111
color: $list-item-active-color;
112112
}
113113

@@ -118,6 +118,17 @@ $generic-list-search-editor-height: round($generic-base-line-height * $generic-b
118118

119119
@include toggle-delete-icon($list-item-active-color);
120120
}
121+
122+
.dx-list-static-delete-button .dx-icon {
123+
color: $list-icon-color;
124+
}
125+
126+
&.dx-state-active,
127+
&.dx-state-focused {
128+
.dx-list-static-delete-button .dx-icon {
129+
color: $base-icon-color;
130+
}
131+
}
121132
}
122133

123134
@mixin dx-list-sizing($item-horizontal-padding) {

packages/devextreme/testing/testcafe/tests/editors/list/common.ts

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ClientFunction } from 'testcafe';
2-
import { isMaterialBased, isFluent } from '../../../helpers/themeUtils';
2+
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
3+
import { isMaterialBased, isFluent, testScreenshot } from '../../../helpers/themeUtils';
34
import url from '../../../helpers/getPageUrl';
45
import List from '../../../model/list';
56
import { createWidget } from '../../../helpers/createWidget';
@@ -323,6 +324,49 @@ test('Disabled item should be focused on tab press to match accessibility criter
323324
searchEnabled: true,
324325
}));
325326

327+
test('The delete button should be displayed correctly after the list item focused (T1216108)', async (t) => {
328+
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
329+
const list = new List('#container');
330+
331+
await list.focus();
332+
333+
await testScreenshot(t, takeScreenshot, 'List delete button when item is focused.png');
334+
335+
await t
336+
.expect(compareResults.isValid())
337+
.ok(compareResults.errorMessages());
338+
}).before(async () => createWidget('dxList', {
339+
dataSource: [{
340+
text: 'item 1',
341+
icon: 'user',
342+
}],
343+
allowItemDeleting: true,
344+
itemDeleteMode: 'static',
345+
}));
346+
347+
test('The button icon in custom template should be displayed correctly after the list item focused (T1216108)', async (t) => {
348+
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
349+
const list = new List('#container');
350+
351+
await list.focus();
352+
353+
await testScreenshot(t, takeScreenshot, 'List icon in button when item is focused.png');
354+
355+
await t
356+
.expect(compareResults.isValid())
357+
.ok(compareResults.errorMessages());
358+
}).before(async () => createWidget('dxList', {
359+
dataSource: [{ text: 'item 1' }],
360+
itemTemplate: (_, __, element) => {
361+
const button = ($('<div>') as any).dxButton({
362+
text: 'custom',
363+
icon: 'home',
364+
});
365+
366+
element.append(button);
367+
},
368+
}));
369+
326370
test('Checking simple list with selectAll and "more" button via aXe', async (t) => {
327371
await a11yCheck(t);
328372
}).before(async () => createWidget('dxList', {

0 commit comments

Comments
 (0)