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
Bug - DataList - No way to mix expandable and non-expandable content #7950
Comments
Just to follow up on #7950 ... this is clearly not a good way to pad it out, as it seems to change based on something I can't quite figure out in different situations (between local testing environment and the site deployed by our CI environment, see below) |
My next attempt is with a fixed-size span to simulate the icon, and using the item-control margin on it; this seems to work <DataListCell key='padding-icon' isIcon={true} style={{marginRight: 'var(--pf-c-data-list__item-control--MarginRight)'}}>
<span style={{display: 'inline-block', minWidth: '40px'}}></span>
</DataListCell> |
Hey @ianw, the datalist component does not support columnar layout in all cases. Assuming it's a good fit, typically we recommend the table component if you are trying to maintain column alignment. Would that work? --
FWIW, just some thoughts while thinking through this, this would probably be the easiest way to support that now. I created a demo here to show a few of ways of doing that - https://codepen.io/mcoker/pen/PoeoBjE. The solution is basically to use CSS to hide the data list control element visually, but retain its layout in the page, and make sure the element and any children (the toggle button) can't be interacted with and are not read by any assistive technology.
Do you want to give any of those a shot? We could look at adding this support to the component, too. And another solution on our end could be to refactor the way we create the layout for the data list to allow for this, without the need to create hidden elements in the layout for alignment purposes. We support the combination of expandable and non-expandable nodes in some of our newer components, like the tree view component, so we could use a similar layout in data list though that update may be the kind of thing we consider in a major release as it might be breaking. |
Yeah, I was trying not to rewrite it too much :) I would say the datalist works well for this; except for this small issue.
I can set the opacity in our CSS and that works to hide it, but I couldn't figure out to disable the button using React? I just have have a
I obviously don't have a great global view, but something like a For reference the upstream change that I'm working on is https://review.opendev.org/c/zuul/zuul/+/854556. We have good CI on this but it does take a couple of clicks if you're looking at that review in gerrit; you'd go "Zuul Summary" -> zuul-build-dashboard-opendev -> (shows the CI run) -> Artifacts tab -> Site Preview -> Click on "Builds" column of OpenStack -> choose any job to examine -> click "Console" tab. A follow-on change https://review.opendev.org/c/zuul/zuul/+/855297 fiddles the CSS to make the datalist more compressed, which was asked for in reviews there. That's neither here or there, but it is more what we want to commit. |
Per the discussion above, I think the easiest way forward would be to add a prop to |
@ianw will this address your problem? ^^^ |
@mcarrano -- yes; passing via props+some css works too :) whatever is most idiomatic for PF |
Describe the problem
I'm trying to replace some PF3 era
ListView
things withDataList
. One thing that I can't seem to work around is that when mixing expandable and non-expandable rows, there's no way to keep the offset of the text consistent. Screenshots below are the easiest way to see this.Some way of putting a blank
DataListToggle
would help. Or maybe it could have a "disabled" flag or something. Or is there some way to make this line up I'm missing?Screenshots
Old view
The text was updated successfully, but these errors were encountered: