You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the CodeSnippet component in single line mode, a horizontal scroll bar will render, which shifts the <pre> wrapped code upward so that it is not centered.
This is related to CodeSnippet when the type prop is set to single.
What did you expect to happen? What happened instead? What would you like to
see changed?
I expected to see the code centered as it is when the text width does not exceed the container. Instead, the text shifted upwards, possibly offset by the scrollbar.
What browser are you working in?
This behavior was observed in:
Chrome 79.0.3945.130
Safari 13.0.3 (15608.3.10.1.4)
Firefox 72.0.1
What version of the Carbon Design System are you using?
This is Carbon 10 design system, with the 7.9.0 version of carbon-components-react
Steps to reproduce the issue
Create a <CodeSnippet type="single" /> component
Provide child text that is long enough to exceed the width of the component
Observe a horizontal scroll bar render and offset the Y position of the text so that it is no longer centered.
What package(s) are you using?
carbon-components
carbon-components-react
Detailed description
When using the
CodeSnippet
component in single line mode, a horizontal scroll bar will render, which shifts the<pre>
wrapped code upward so that it is not centered.Behavior observed in Storybook
This is related to
CodeSnippet
when thetype
prop is set tosingle
.I expected to see the code centered as it is when the text width does not exceed the container. Instead, the text shifted upwards, possibly offset by the scrollbar.
This behavior was observed in:
This is Carbon 10 design system, with the
7.9.0
version ofcarbon-components-react
Steps to reproduce the issue
<CodeSnippet type="single" />
componentReproducible demo here: https://codesandbox.io/s/musing-surf-1jyot
Additionally, this is observable in the public Storybook example: http://react.carbondesignsystem.com/?path=/story/codesnippet--single-line
The text was updated successfully, but these errors were encountered: