Skip to content

Commit abd8f94

Browse files
authored
DataGrid - ColorBox in DataGrid causes input value to appear behind color preview (T1280023) (#29979)
1 parent f032b39 commit abd8f94

File tree

6 files changed

+58
-12
lines changed

6 files changed

+58
-12
lines changed

e2e/testcafe-devextreme/tests/dataGrid/common/editing.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import url from '../../../helpers/getPageUrl';
99
import { createWidget } from '../../../helpers/createWidget';
1010
import { changeTheme } from '../../../helpers/changeTheme';
1111
import { getData } from '../helpers/generateDataSourceData';
12+
import { Themes } from '../../../helpers/themes';
1213

1314
fixture.disablePageReloads`Editing`
1415
.page(url(__dirname, '../../container.html'));
@@ -2767,3 +2768,42 @@ test('DataGrid - A new row is added above the existing row if the data source is
27672768
},
27682769
],
27692770
}));
2771+
2772+
[
2773+
Themes.genericLight,
2774+
Themes.fluentBlue,
2775+
Themes.materialBlue,
2776+
].forEach((theme) => {
2777+
test('DataGrid - ColorBox in DataGrid causes input value to appear behind color preview (T1280023)', async (t) => {
2778+
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
2779+
const dataGrid = new DataGrid('#container');
2780+
2781+
await t.click(dataGrid.getDataCell(0, 0).element);
2782+
2783+
await t
2784+
.expect(await takeScreenshot(`grid-form-editing-with-color-box_(${theme})`, dataGrid.element))
2785+
.ok()
2786+
.expect(compareResults.isValid())
2787+
.ok(compareResults.errorMessages());
2788+
})
2789+
.before(async () => {
2790+
await changeTheme(theme);
2791+
await createWidget('dxDataGrid', {
2792+
dataSource: [
2793+
{ Color: 'red' },
2794+
],
2795+
showBorders: true,
2796+
editing: {
2797+
allowUpdating: true,
2798+
mode: 'cell',
2799+
},
2800+
onEditorPreparing(e) {
2801+
if (e.dataField === 'Color') {
2802+
e.editorName = 'dxColorBox';
2803+
e.editorOptions.readOnly = false;
2804+
}
2805+
},
2806+
});
2807+
})
2808+
.after(async () => changeTheme(Themes.genericLight));
2809+
});
2.32 KB
Loading
1.97 KB
Loading
2.2 KB
Loading

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ $fluent-grid-base-group-panel-message-line-height: $fluent-button-text-line-heig
9292
}
9393

9494
.dx-texteditor {
95-
.dx-texteditor-input,
96-
.dx-placeholder::before {
97-
padding-left: $fluent-grid-base-texteditor-input-padding;
95+
.dx-texteditor-container {
96+
.dx-texteditor-input,
97+
.dx-placeholder::before {
98+
padding-left: $fluent-grid-base-texteditor-input-padding;
99+
}
98100
}
99101
}
100102
}
@@ -480,13 +482,13 @@ $fluent-grid-base-group-panel-message-line-height: $fluent-button-text-line-heig
480482
font-size: $fluent-grid-base-cell-font-size;
481483
height: $fluent-grid-base-cell-height;
482484
line-height: $fluent-grid-base-cell-height;
483-
padding-right: $fluent-grid-base-cell-horizontal-padding;
484-
padding-left: $fluent-grid-base-cell-horizontal-padding;
485-
padding-top: 0;
486-
padding-bottom: 0;
487485
margin-top: 0;
488486
}
489487

488+
&:not(.dx-tagbox):not(.dx-colorbox) .dx-texteditor-input {
489+
padding: 0 $fluent-grid-base-cell-horizontal-padding;
490+
}
491+
490492
.dx-placeholder::before {
491493
padding-right: $fluent-grid-base-cell-horizontal-padding;
492494
padding-left: $fluent-grid-base-cell-horizontal-padding;

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,11 @@ $material-grid-base-group-panel-message-line-height: $material-button-text-line-
8282
}
8383

8484
.dx-texteditor {
85-
.dx-texteditor-input,
86-
.dx-placeholder::before {
87-
padding-left: $material-grid-base-texteditor-input-padding;
85+
.dx-texteditor-container {
86+
.dx-texteditor-input,
87+
.dx-placeholder::before {
88+
padding-left: $material-grid-base-texteditor-input-padding;
89+
}
8890
}
8991
}
9092
}
@@ -458,13 +460,15 @@ $material-grid-base-group-panel-message-line-height: $material-button-text-line-
458460
font-size: $material-grid-base-cell-font-size;
459461
height: $material-grid-base-cell-height;
460462
line-height: $material-grid-base-cell-height;
461-
padding-right: $material-grid-base-cell-horizontal-padding;
462-
padding-left: $material-grid-base-cell-horizontal-padding;
463463
padding-top: 0;
464464
padding-bottom: 0;
465465
margin-top: 0;
466466
}
467467

468+
&:not(.dx-tagbox):not(.dx-colorbox) .dx-texteditor-input {
469+
padding: 0 $material-grid-base-cell-horizontal-padding;
470+
}
471+
468472
.dx-placeholder::before {
469473
padding-right: $material-grid-base-cell-horizontal-padding;
470474
padding-left: $material-grid-base-cell-horizontal-padding;

0 commit comments

Comments
 (0)