Skip to content

fix(ListView component): Remove display: flex from container - #151

Merged
jeff-phillips-18 merged 1 commit into
patternfly:masterfrom
danseethaler:ListView-fix
Jan 5, 2018
Merged

fix(ListView component): Remove display: flex from container#151
jeff-phillips-18 merged 1 commit into
patternfly:masterfrom
danseethaler:ListView-fix

Conversation

@danseethaler

Copy link
Copy Markdown
Contributor

The display: flex incorrectly spaces the children. This causes the actions to be pushed out of the
container when the header text is lengthly.

fix #148

What: Removing inline style display:flex from ListViewRow to fix spacing issue on children. We do need the flex: 1 to grow the children and fill up the row space.

Also added actions to the storybook to see the actions correctly contained.

Link to Storybook:
https://rawgit.com/danseethaler/patternfly-react/ListView-fix-storybook/index.html

@jeff-phillips-18

Copy link
Copy Markdown
Member

Ideally, the ListViewRow container ought not exist at all. The items it contains should be direct descendants of ListViewGroupItemHeader.

Comment thread src/components/ListView/ListViewRow.js Outdated
description
}) => (
<div style={{ display: 'flex', flex: 1 }}>
<div style={{ flex: 1 }}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it possible to remove this <div> altogether now that we have upgraded to React 16? I think the reason this solution works is because we have float fallbacks for browsers that don't support flex, so now removing display: 'flex' results in using those float fallbacks. But ultimately my preference would be to match the patternfly core html structure whenever possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed and updated 👍

The display: flex incorrectly spaces the children. This causes the actions to be pushed out of the
container when the header text is lengthly.

fix #148
@jgiardino

Copy link
Copy Markdown
Contributor

LGTM
Thanks!

@jeff-phillips-18 jeff-phillips-18 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@jeff-phillips-18
jeff-phillips-18 merged commit 956b31e into patternfly:master Jan 5, 2018
@danseethaler
danseethaler deleted the ListView-fix branch January 5, 2018 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Listview.Item actions bleeding off container

3 participants