-
-
Notifications
You must be signed in to change notification settings - Fork 457
docs: wrap examples with overflow issues in the TableContainer
component
#488
docs: wrap examples with overflow issues in the TableContainer
component
#488
Conversation
… with `TableContainer` to prevent overflow in mobile screens
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/chakra-ui/chakra-ui-docs/5Lm3GyYhPKYD9ToNprtLEZGD3b6j |
TableContainer
componentTableContainer
component
…or checkbox group" with TableContainer to prevent overflow in mobile screens
…input" with TableContainer to prevent overflow in mobile screens
…event overflow in mobile screens
…bleContainer to prevent overflow in mobile screens
… to prevent overflow in mobile screens
…event overflow in mobile screens
…vent overflow in mobile screens
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.
This looks good to me! I would only put the comment for Tablecontainer
in my one place. But that's personal preference I guess.
@noobinthisgame yea I thought about that. But if anyone added a new example that had the potential of overflow, I would think to also add a PR to the Contributing file and docsite page to add instructions to add the |
I thought about this and I think we need to be smarter about it. I know it fixes the issue, but here are some cons that I have thought of:
Why don't we just modify the CodeBlock component in |
@nikolovlazar agreed! Probably better to close this PR and open a fresh one? |
Also, @nikolovlazar, just to clarify: wouldn't adding overflow prop to the Edit: I just played around with it. The overflow should be applied to the if (isMounted && language === 'jsx' && _live === true) {
return <ReactLiveBlock editable {...reactLiveBlockProps} />
} Also, with the example from the section Sample Usage for a Radio or Checkbox Group, say, the text content at the end of a row of elements would become compressed, and may need to be resolved with something like |
I'm sorry guys I mixed this PR up with another one. Your guys proposal is what we want! |
All good, @noobinthisgame! It was still good to show the |
Yeah I think so too @TylerAPfledderer. The example you shared does have a longer text and on mobile it goes out of the preview box. The
The preview is rendered in the |
@nikolovlazar so wrapping <Box overflowX='auto' whiteSpace='pre'>
<LiveCodePreview zIndex='1' />
</Box> I believe applying the changes to line 10 in const LiveCodePreview = chakra(LivePreview, {
baseStyle: {
fontFamily: 'body',
mt: 5,
p: 3,
borderWidth: 1,
borderRadius: '12px',
overflowX: 'auto',
whiteSpace: 'pre'
},
}) |
@TylerAPfledderer that's the solution! Apply those changes, clean up the PR and let me know when it's ready to be reviewed. |
Closing this pull request to avoid polluting the commit history with bad commits. Opening a new PR to push the proper changes for the same overflow issue. |
📝 Description
This pull request surveys live code previews site-wide and wraps the code in the
TableContainer
component so the previews do not overflow the container when viewing in mobile screens.This does not address any issues with the examples themselves not rendering as intended in mobile screens.
Found sections to fix:
⛳️ Current behavior (updates)
One or more live preview examples in the docs overflow their
react-live
preview container when viewed on a mobile screen🚀 New behavior
The wrapping
TableContainer
component with render anoverflow-x: auto
to the offending examples to create a horizontal scroll.💣 Is this a breaking change (Yes/No):
No
📝 Additional Information
Still in draft as all doc pages have not been reviewed. Description of the pull request may change based on further findings.
Using
TableContainer
instead applying a globaloverflow: auto
style to the react-live preview component was recommended by the docsite maintainer.Consider this PR to be an interim temporary solution to at least some of the examples in question that need to be redone. (In that case, open separate issues/PRs for each example)