Currently, I am utilizing react-split
, but I am encountering an issue where the first pane requires scrolling down to display the horizontal scrollbar.
I would like both the vertical and horizontal scrollbars to be visible simultaneously.
Below is the code snippet:
https://codesandbox.io/s/vibrant-flower-ueywiu
App
function App() {
return (
<Split
className="split"
direction="vertical"
minSize={0}
snapOffset={10}
dragInterval={5}
sizes={[30, 70]}
>
<Market />
<chakra.div bg="blue">
<Center h="100%" p="16" textAlign="center">
<Heading color="white">
How to show the horizontal scrollbar without needing to scroll down?
</Heading>
</Center>
</chakra.div>
</Split>
);
}
Market
const Market = (props) => {
return (
<chakra.div {...props} overflow="auto">
<Tabs isLazy>
<TabList>
<Tab>Stocks</Tab>
<Tab>FTSE 100</Tab>
</TabList>
<TabPanels>
<TabPanel padding={0}>
<MarketTable />
</TabPanel>
<TabPanel padding={0}>
<p>Empty</p>
</TabPanel>
</TabPanels>
</Tabs>
</chakra.div>
);
};
MarketTable
const MarketTable = () => {
return (
<TableContainer>
<Table size="sm">
<Thead>
<Tr>
<Th>Title</Th>
<Th>Quote</Th>
<Th>Date/Time</Th>
<Th>Place</Th>
<Th>Variation</Th>
<Th>CMP</Th>
<Th>VND</Th>
<Th>Min</Th>
<Th>Max</Th>
<Th>Volume</Th>
</Tr>
</Thead>
<Tbody>
{data.map((each) => (
<Tr key={each.name}>
<Td title={String(each.name ?? EMPTY_CHAR)}>
{each.name ?? EMPTY_CHAR}
</Td>
<Td title={String(each.quote ?? EMPTY_CHAR)}>
{each.quote ?? EMPTY_CHAR}
</Td>
<Td title={String(each.dateTime ?? EMPTY_CHAR)}>
{each.dateTime ?? EMPTY_CHAR}
</Td>
<Td title={String(each.place.name ?? EMPTY_CHAR)}>
{each.place.name ?? EMPTY_CHAR}
</Td>
<Td title={String(each.variationPercent ?? EMPTY_CHAR)}>
{each.variationPercent ?? EMPTY_CHAR}
</Td>
<Td title={String(each.cmp ?? EMPTY_CHAR)}>
{each.cmp ?? EMPTY_CHAR}
</Td>
<Td title={String(each.vnd ?? EMPTY_CHAR)}>
{each.vnd ?? EMPTY_CHAR}
</Td>
<Td title={String(each.min ?? EMPTY_CHAR)}>
{each.min ?? EMPTY_CHAR}
</Td>
<Td title={String(each.max ?? EMPTY_CHAR)}>
{each.max ?? EMPTY_CHAR}
</Td>
<Td title={String(each.volume ?? EMPTY_CHAR)}>
{each.volume ?? EMPTY_CHAR}
</Td>
</Tr>
))}
</Tbody>
</Table>
</TableContainer>
);
};