Skip to content

Commit

Permalink
DataGrid - TagBox tags are incorrectly rendered if the Material/Fluen…
Browse files Browse the repository at this point in the history
…t theme is used (T1228720) (#27865)
  • Loading branch information
tongsonbarbs authored Aug 5, 2024
1 parent 4e34bd2 commit 588b527
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 22 deletions.
14 changes: 3 additions & 11 deletions packages/devextreme/scss/widgets/fluent/gridBase/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,11 @@ $fluent-grid-base-group-panel-message-line-height: $fluent-button-text-line-heig
}
}

.dx-editor-with-menu {
.dx-#{$widget-name}-filter-row .dx-editor-with-menu {
.dx-menu-item-content {
display: flex;
justify-content: center;
align-items: center;

.dx-icon {
@include dx-icon-sizing($fluent-grid-base-filter-icon-size - 4);

&.dx-icon-filter-operation-default {
margin-top: 2px;
}
}
}

.dx-texteditor {
Expand Down Expand Up @@ -436,7 +428,7 @@ $fluent-grid-base-group-panel-message-line-height: $fluent-button-text-line-heig
box-shadow: none;
}

.dx-texteditor-input {
&:not(.dx-tagbox) .dx-texteditor-input {
background: $datagrid-editor-bg;
font-size: $fluent-grid-base-cell-font-size;
height: $fluent-grid-base-cell-height;
Expand All @@ -462,7 +454,7 @@ $fluent-grid-base-group-panel-message-line-height: $fluent-button-text-line-heig
}
}

.dx-tag-container {
&:not(.dx-tagbox) .dx-tag-container {
min-height: $fluent-grid-base-cell-height;
padding: 0;
}
Expand Down
14 changes: 3 additions & 11 deletions packages/devextreme/scss/widgets/material/gridBase/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,11 @@ $material-grid-base-group-panel-message-line-height: $material-button-text-line-
}
}

.dx-editor-with-menu {
.dx-#{$widget-name}-filter-row .dx-editor-with-menu {
.dx-menu-item-content {
display: flex;
justify-content: center;
align-items: center;

.dx-icon {
@include dx-icon-sizing($material-grid-base-filter-icon-size - 4);

&.dx-icon-filter-operation-default {
margin-top: 2px;
}
}
}

.dx-texteditor {
Expand Down Expand Up @@ -414,7 +406,7 @@ $material-grid-base-group-panel-message-line-height: $material-button-text-line-
box-shadow: none;
}

.dx-texteditor-input {
&:not(.dx-tagbox) .dx-texteditor-input {
background: $datagrid-editor-bg;
font-size: $material-grid-base-cell-font-size;
height: $material-grid-base-cell-height;
Expand All @@ -440,7 +432,7 @@ $material-grid-base-group-panel-message-line-height: $material-button-text-line-
}
}

.dx-tag-container {
&:not(.dx-tagbox) .dx-tag-container {
min-height: $material-grid-base-cell-height;
padding: 0;
}
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.
69 changes: 69 additions & 0 deletions packages/devextreme/testing/testcafe/tests/dataGrid/tagBox.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
import DataGrid from '../../model/dataGrid';
import url from '../../helpers/getPageUrl';
import { createWidget } from '../../helpers/createWidget';
import { changeTheme } from '../../helpers/changeTheme';
import { Themes } from '../../helpers/themes';

fixture.disablePageReloads`Tagbox Columns`.page(
url(__dirname, '../container.html'),
);
// T1228720
[Themes.genericLight, Themes.materialBlue, Themes.fluentBlue].forEach(
(theme) => {
test('Datagrid tagbox column should not look broken', async (t) => {
const dataGrid = new DataGrid('#container');
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
await t
.click(dataGrid.getDataCell(0, 1).element)
.expect(
await takeScreenshot(
`T1228720-grid-tagbox-on-edit_(${theme}).png`,
dataGrid.element,
),
)
.ok()
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
})
.before(async () => {
await changeTheme(theme);
await createWidget('dxDataGrid', {
showBorders: true,
allowColumnResizing: true,
dataSource: [{ id: 1, items: [1, 2, 3, 4, 5] }],
columns: [
'id',
{
dataField: 'items',
editCellTemplate(container, cellInfo) {
($('<div/>') as any)
.dxTagBox({
dataSource: Array.from({ length: 10 }, (_, index) => ({
id: index + 1,
text: `item ${index + 1}`,
})),
value: cellInfo.value,
valueExpr: 'id',
displayExpr: 'text',
onValueChanged(e) {
cellInfo.setValue(e.value);
},
onSelectionChanged() {
cellInfo.component.updateDimensions();
},
searchEnabled: true,
})
.appendTo(container);
},
},
],
editing: { mode: 'batch', allowUpdating: true },
});
})
.after(async () => {
await changeTheme(Themes.genericLight);
});
},
);

0 comments on commit 588b527

Please sign in to comment.