-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[docs] Batch small changes #5177
[docs] Batch small changes #5177
Conversation
These are the results for the performance tests:
|
@@ -1,4 +1,4 @@ | |||
import React from 'react'; | |||
import * as React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Official import https://beta.reactjs.org/apis
@@ -119,7 +119,6 @@ const GridToolbarFilterButton = React.forwardRef<HTMLButtonElement, GridToolbarF | |||
<rootProps.components.BaseButton | |||
ref={ref} | |||
size="small" | |||
color="primary" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
color primary is now the default in the minimum version of Material UI we depend on: https://mui.com/material-ui/migration/v5-component-changes/#%E2%9C%85-remove-default-color-prop
@@ -44,7 +44,7 @@ function EditStatus(props: GridRenderEditCellParams<string>) { | |||
onClose: handleClose, | |||
}} | |||
sx={{ | |||
height: 1, | |||
height: '100%', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is kind of confusing for people that don't know https://mui.com/system/sizing/#supported-values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use it a lot to avoid prettier from breaking the lines. 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha, right, well, happy to hear other's perspectives on this. I think that the main value is the feature is so that developers can do:
height: '100%', | |
height: 1/2, |
we supported height: 1 for consistency and to match styled-system. height: 2
generate a height of 2px 🙃. In MUI Core, we never use this API.
cc @mnajdova should we consider removing the documentation of it in https://mui.com/system/sizing/#supported-values?
Tailwind CSS used full
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @mnajdova should we consider removing the documentation of it in https://mui.com/system/sizing/#supported-values?
Agree, I remember another discussion some time ago about the same topic. Linking the comment to the v6 milestone for removal and yep, will remove the docs for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea moved to mui/material-ui#38583.
@@ -124,7 +124,7 @@ export default function TreeDataDisableChildrenSorting() { | |||
]); | |||
|
|||
return ( | |||
<Stack style={{ width: '100%' }} alignItems="flex-start" spacing={2}> | |||
<Box sx={{ width: '100%' }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Less code
@@ -10,7 +11,7 @@ export default function SxProp() { | |||
}); | |||
|
|||
return ( | |||
<div style={{ height: 300, width: '100%' }}> | |||
<Box sx={{ height: 300, width: '100%' }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid inline style per https://web.dev/csp/#inline-code-is-considered-harmful
) => { | ||
dispatch({ type: 'setNewViewLabel', label: e.target.value }); | ||
dispatch({ type: 'setNewViewLabel', label: event.target.value }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid shorthands
@@ -212,7 +212,7 @@ const NewViewListButton = (props: { | |||
); | |||
}; | |||
|
|||
const CustomToolbar = () => { | |||
function CustomToolbar() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convention for top-level components
To install it: | ||
|
||
```sh | ||
// with npm | ||
npm install exceljs | ||
|
||
// with yarn | ||
yarn add exceljs | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer needed since we changed the dependencies in the package.json
@@ -206,7 +206,7 @@ For more option to customize the print export, please visit the [`printOptions` | |||
:::warning | |||
Due to the fact that the Print export relies on the usage of an `iframe`, there is a limitation around the usage of `X-Frame-Options`. | |||
|
|||
In order for the Print export to work as expected set `X-Frame-Options: SAMEORIGIN`. | |||
In order for the Print export to work as expected set `X-Frame-Options: SAMEORIGIN` or unset the `X-Frame-Options` header. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both works.
docs/data/data-grid/row-grouping/RowGroupingSortingSingleGroupingColDef.tsx
Outdated
Show resolved
Hide resolved
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
d80ec70
to
513fd9b
Compare
513fd9b
to
68536ce
Compare
The effort started from this comment #5114 (comment).
https://deploy-preview-5177--material-ui-x.netlify.app/x/react-data-grid/layout/#auto-height