Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataGrid] Fix flex columns and resize #2110

Closed
wants to merge 5 commits into from

Conversation

dtassone
Copy link
Member

@dtassone dtassone commented Jul 9, 2021

@dtassone dtassone requested a review from a team July 9, 2021 10:53
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • We miss a test case
  • There is a CSS regression, see argos once it has finish running

Comment on lines +367 to +394
export function FlexLayoutGrid() {
const { data } = useDemoData({
dataSet: 'Commodity',
rowLength: 15,
maxColumns: 6,
});

const tmpData = JSON.parse(JSON.stringify(data));
tmpData.columns.forEach((item) => {
item.flex = 1;
});
return (
<div style={{ height: '400px', width: '400px' }}>
<div style={{ display: 'flex', height: '100%' }}>
<div style={{ flexGrow: 1 }}>
<XGrid
autoHeight
showCellRightBorder
showColumnRightBorder
disableExtendRowFullWidth
rows={tmpData.rows}
columns={tmpData.columns}
/>
</div>
</div>
</div>
);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can already reproduce the issue in the docs. What's the use case for the story?

Suggested change
export function FlexLayoutGrid() {
const { data } = useDemoData({
dataSet: 'Commodity',
rowLength: 15,
maxColumns: 6,
});
const tmpData = JSON.parse(JSON.stringify(data));
tmpData.columns.forEach((item) => {
item.flex = 1;
});
return (
<div style={{ height: '400px', width: '400px' }}>
<div style={{ display: 'flex', height: '100%' }}>
<div style={{ flexGrow: 1 }}>
<XGrid
autoHeight
showCellRightBorder
showColumnRightBorder
disableExtendRowFullWidth
rows={tmpData.rows}
columns={tmpData.columns}
/>
</div>
</div>
</div>
);
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

working on flex columns, and see if it works. Where is #2011 in the doc?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, could we make it a Snap story in this case? This could complement the function test to make sure the rendering with sub-pixels is still correct

@@ -22,6 +22,7 @@ export const GridEmptyCell = React.memo(function GridEmptyCell({
lineHeight: `${height - 1}px`,
minHeight: height,
maxHeight: height,
padding: 0,
Copy link
Member

@oliviertassinari oliviertassinari Jul 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need?

Suggested change
padding: 0,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that the cell always have a padding of 10px
But we do not want it on the GridEmptyCell.

Maybe we should add a class to this cell and set the padding to 0 in the rootStyle instead of here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@oliviertassinari oliviertassinari changed the title [DataGrid] fix flex columns and resize [DataGrid] Fix flex columns and resize Jul 9, 2021
@oliviertassinari oliviertassinari requested a review from a team July 9, 2021 11:14
@dtassone
Copy link
Member Author

dtassone commented Jul 9, 2021

  • We miss a test case
  • There is a CSS regression, see argos once it has finish running

Yes I moved the separator to avoid negative margin that creates issue on resize

@m4theushw
Copy link
Member

About #2011, the double border is still there.

image

The separator is being displayed when showColumnRightBorder is used.

image

@dtassone
Copy link
Member Author

dtassone commented Jul 9, 2021

About #2011, the double border is still there.

A separate issue that can be fixed in another PR. We need to keep PR small

@m4theushw
Copy link
Member

I'm confused, we have this PR and #2104 both trying to fix #2103.

About the solution proposed to fix it here, it's still trying to scroll, but since we removed the padding from the empty cell it can't. We're not fixing the root cause #2103 (comment). To reproduce, use fixed size columns.

siTztA0h5p.mp4

@flaviendelangle
Copy link
Member

flaviendelangle commented Jul 9, 2021

@m4theushw for me this PR is a follow up on #2104 because there are several issues to be fixed around the column width.

The scroll event should be fixed here #2104 (comment)

@dtassone
Copy link
Member Author

dtassone commented Jul 9, 2021

the separator creates an extra 10px on the columns header due to its positioning. The problem is the icon shape that is a square 24x24 instead of just a bar 24x2 which would be easier to position

@dtassone
Copy link
Member Author

I managed to fix the icon and put the bar on the right side of the icon so we can position it properly without using negative margin. let me know what you think

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please isolate the fix of #2011 and #2103. Looking at the changes, here are no reason to bundle them.

Comment on lines +367 to +394
export function FlexLayoutGrid() {
const { data } = useDemoData({
dataSet: 'Commodity',
rowLength: 15,
maxColumns: 6,
});

const tmpData = JSON.parse(JSON.stringify(data));
tmpData.columns.forEach((item) => {
item.flex = 1;
});
return (
<div style={{ height: '400px', width: '400px' }}>
<div style={{ display: 'flex', height: '100%' }}>
<div style={{ flexGrow: 1 }}>
<XGrid
autoHeight
showCellRightBorder
showColumnRightBorder
disableExtendRowFullWidth
rows={tmpData.rows}
columns={tmpData.columns}
/>
</div>
</div>
</div>
);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, could we make it a Snap story in this case? This could complement the function test to make sure the rendering with sub-pixels is still correct

@oliviertassinari
Copy link
Member

We can resume the effort later on

@oliviertassinari oliviertassinari added the component: data grid This is the name of the generic UI component, not the React module! label Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module!
Projects
None yet
4 participants