Skip to content
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 report: Large tables causing horizontal scrolling on mobile #35

Open
wackerow opened this issue Aug 4, 2023 · 0 comments · Fixed by #84
Open

Bug report: Large tables causing horizontal scrolling on mobile #35

wackerow opened this issue Aug 4, 2023 · 0 comments · Fixed by #84

Comments

@wackerow
Copy link
Member

wackerow commented Aug 4, 2023

Describe the bug

Markdown tables are currently supported, however, they are not styled appropriately to prevent horizontal scroll for large tables on mobile devices.

This has surfaced during discussions for the upcoming events page template found in PR #34, where markdown tables were going to be used to display an agenda.

To reproduce

Currently not able to reproduce from production, as no tables are being used yet. After #34 is merged, then this can be seen on https://soliditylang.org/solidity-summit-2022 on a mobile screen. This table will overflow the size of the parent adding undesired horizontal scroll to the window.

Expected behavior

Table is bound by a box that caps the width with the parent and uses overflow auto to handle scrolling for the table alone when needed.

Screenshots

No response

Desktop (please complete the following information)

No response

Smartphone (please complete the following information)

No response

Additional context

During attempts to implement, receiving an error for the Chakra-UI Table component.

The markdown components are styled using ChakraUIRenderer from the chakra-ui-markdown-renderer library, handled within the src/styles/MDStyles.tsx file. When attempting to add a styled table entry to the object, the following error results:

Server Error
ContextError: useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Table />" 

The pattern attempted was:

  table: ({ children }: any) => (
    <Flex overflowX='auto'>
      <Table
        variant='striped'
        border='1px'
        borderColor='blackAlpha.50'
        my='6 !important'
        size={{ base: 'sm', lg: 'md' }}
        w='auto'
      >
        {children}
      </Table>
    </Flex>
  ),

... which is analogous to that used in the Geth Website repo located here.

This was withheld from PR #34 to prevent blocking the new event page.

wackerow added a commit that referenced this issue Jun 20, 2024
feat: add markdown table component [Fixes #35]
@wackerow wackerow reopened this Jun 20, 2024
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 a pull request may close this issue.

1 participant