I am using react-split and I would like the first pane to show the horizontal scrollbar without needing to scroll down.
As of right now, to scroll horizontally (using the scrollbar) you have the scroll down first.
I`d like to have both scrollbars showing.
My code: 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 the need to scroll
down?
</Heading>
</Center>
</chakra.div>
</Split>
);
}
Market
const Market = (props) => {
return (
<chakra.div {...props} overflow="auto">
<Tabs isLazy>
<TabList>
<Tab>Acções</Tab>
<Tab>PSI 20</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>Título</Th>
<Th>Cotacao</Th>
<Th>Data/Hora</Th>
<Th>Praça</Th>
<Th>Variação</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.nome}>
<Td title={String(each.nome ?? EMPTY_CHAR)}>
{each.nome ?? EMPTY_CHAR}
</Td>
<Td title={String(each.cotacao ?? EMPTY_CHAR)}>
{each.cotacao ?? EMPTY_CHAR}
</Td>
<Td title={String(each.dataHora ?? EMPTY_CHAR)}>
{each.dataHora ?? EMPTY_CHAR}
</Td>
<Td title={String(each.praca.nome ?? EMPTY_CHAR)}>
{each.praca.nome ?? EMPTY_CHAR}
</Td>
<Td title={String(each.variacaoPercent ?? EMPTY_CHAR)}>
{each.variacaoPercent ?? 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>
);
};