-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
[Divider] Fix height for vertical divider in a flexbox #19614
Changes from all commits
5d03946
3b87743
974a37d
d91bbab
9c0f867
80fabbf
6e1a679
d4d91fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -38,6 +38,11 @@ export const styles = theme => ({ | |||||||||
height: '100%', | ||||||||||
width: 1, | ||||||||||
}, | ||||||||||
/* Styles applied to the root element if `flexItem={true}`. */ | ||||||||||
flexItem: { | ||||||||||
alignSelf: 'stretch', | ||||||||||
height: 'auto', | ||||||||||
}, | ||||||||||
}); | ||||||||||
|
||||||||||
const Divider = React.forwardRef(function Divider(props, ref) { | ||||||||||
|
@@ -46,6 +51,7 @@ const Divider = React.forwardRef(function Divider(props, ref) { | |||||||||
classes, | ||||||||||
className, | ||||||||||
component: Component = 'hr', | ||||||||||
flexItem = false, | ||||||||||
light = false, | ||||||||||
orientation = 'horizontal', | ||||||||||
role = Component !== 'hr' ? 'separator' : undefined, | ||||||||||
|
@@ -60,6 +66,7 @@ const Divider = React.forwardRef(function Divider(props, ref) { | |||||||||
{ | ||||||||||
[classes[variant]]: variant !== 'fullWidth', | ||||||||||
[classes.absolute]: absolute, | ||||||||||
[classes.flexItem]: flexItem, | ||||||||||
[classes.light]: light, | ||||||||||
[classes.vertical]: orientation === 'vertical', | ||||||||||
}, | ||||||||||
|
@@ -91,6 +98,10 @@ Divider.propTypes = { | |||||||||
* Either a string to use a DOM element or a component. | ||||||||||
*/ | ||||||||||
component: PropTypes.elementType, | ||||||||||
/** | ||||||||||
* If `true`, the divider will apply adapt to a parent flex container. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
? (Fixes the grammar, but it's still not clear what this is actually trying to say.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure how we could better explain the role of this prop. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could spell it out 🤷♂:
Suggested change
|
||||||||||
*/ | ||||||||||
flexItem: PropTypes.bool, | ||||||||||
/** | ||||||||||
* If `true`, the divider will have a lighter color. | ||||||||||
*/ | ||||||||||
|
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.
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.
Thanks, I take care of it in a follow-up.