Open guigueb opened 3 years ago
This bug is described in #7551
@guigueb By default, the scrolling is set to wrap. You can set wrapText={false}
on the CodeSnippet
, which will allow horizontal scrolling. However, since the container is fully expanded (but hidden beneath the outer container), the scroll bar only shows up once the entire snippet has been expanded:
Since the scroll bar is not in view when the CodeSnippet is collapsed, they've added an overflow indicator to show that there is more content off the screen
Let me know if this is a viable solution, or if you have any alternative solutions you would like to explore!
Just to be clear...
Given <CodeSnippet wrapText={false}>
in closed mode (ShowMore button showing) and data that exceeds the width and length of the visible data area.
The horizontal and vertical scroll bars are there but not in view. So the solution is to show show lighter-text to indicate there is more?
So there is lighter-text to the right and/or left to indicate users can scroll in those directions. Will the top/bottom rows be lighter-text to indicate to users they can scroll in those directions? We do loose the 'grab and drag' ability that scroll bars give us.
When I address https://github.com/carbon-design-system/carbon/issues/7579 maybe we can re-evaluated the choice of scrollbars vs lighter-text. When/if numberOfRowsOpened = numberOfRowsClosed and the ShowMore/ShowLess buttons are not there I'm not sure lighter-text will cut it.
About the comment "However, since the container is fully expanded (but hidden beneath the outer container), the scroll bar only shows up once the entire snippet has been expanded:"
One of the use cases IBM Cognos has for CodeSnippet is to show validation error information. It is not uncommon for this information to be 1000+ lines long with line lengths that are also very large. As this is formatted data - wrapping it would loose the nice formatting (indentation, alignment, and such). With the scroll bars being at the end and bottom of the container holding the data they will never be usable.
That said there are other options... copy/paste, find, etc.
PR #8156 is in draft mode. It has the scrollbar/overflow changes and will allow you test the scrollbars and see the colliding issue
CodeSnippet: missing horizontal scrollbar when type is multi and there is a long row of data
What package(s) are you using?
carbon-components
carbon-components-react
Detailed description
When you have a long row of data and the type='single'...
When you have a long row of data and the type='multi'...
This shows in the latest Carbon Design System using any browser.
Steps to reproduce the issue