Skip to content

Commit 0aaa92c

Browse files
authored
fix: column headers (#1031)
1 parent 94b90eb commit 0aaa92c

File tree

5 files changed

+432
-348
lines changed

5 files changed

+432
-348
lines changed

.changeset/dull-boats-join.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ensembleui/react-runtime": patch
3+
---
4+
5+
fix column header by adding minWidth

packages/runtime/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"@types/react": "^18.2.21",
4444
"@types/react-dom": "^18.2.0",
4545
"@types/react-resizable": "3.0.7",
46-
"antd": "^5.20.0",
46+
"antd": "^5.21.0",
4747
"chart.js": "^4.4.2",
4848
"chartjs-plugin-datalabels": "^2.2.0",
4949
"dayjs": "^1.11.12",

packages/runtime/src/widgets/DataGrid/DataGrid.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ export const DataGrid: React.FC<GridProps> = (props) => {
506506
? { display: "none" }
507507
: undefined),
508508
}}
509+
tableLayout="auto"
509510
virtual={values?.virtual}
510511
>
511512
{dataColumns.map((col, colIndex) => {
@@ -518,6 +519,7 @@ export const DataGrid: React.FC<GridProps> = (props) => {
518519
}))}
519520
hidden={col.visible === false}
520521
key={colIndex}
522+
minWidth={col.width ?? 100}
521523
onFilter={
522524
col.filter?.onFilter
523525
? (value, record): boolean =>

packages/runtime/src/widgets/Form/MultiSelect.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ const MultiSelect: React.FC<MultiSelectProps> = (props) => {
207207
// handle option change
208208
const handleChange = (
209209
value: MultiSelectOption[],
210-
option: MultiSelectOption | MultiSelectOption[],
210+
option?: MultiSelectOption | MultiSelectOption[],
211211
): void => {
212212
setSelectedValues(value);
213-
if (action) onChangeCallback({ value, option });
213+
if (action) onChangeCallback({ value, option: option ?? [] });
214214
else onItemSelectCallback(value);
215215

216216
if (newOption) {

0 commit comments

Comments
 (0)