mirror of
https://github.com/Zakkaus/doona.git
synced 2026-12-05 16:02:03 +00:00
fix(ui): keep the tab bar as wide as its tabs
This commit is contained in:
1 parent
1a47e2ff8d
commit
e19bf6f43f
2 files changed
+11
-1
No files matched your search
@@ -82,3 +82,12 @@ for (const path of ['dns?tab=cache', 'dns?tab=log', 'nodes?tab=list', 'flows?tab
|
||||
test(`${path}: a table comes back from another tab at its final column widths`, async ({page}) => {
|
||||
await switchBack(page, path);
|
||||
});
|
||||
|
||||
// The bar is as wide as its tabs, not the row the panels share.
|
||||
test('a tab bar keeps the width of its tabs', async ({page}) => {
|
||||
await page.goto('/#/dns?tab=stats');
|
||||
const bar = page.locator('.rp-tabbar').first();
|
||||
await expect(bar).toBeVisible();
|
||||
const [barWidth, rowWidth] = await bar.evaluate(el => [el.getBoundingClientRect().width, el.parentElement!.getBoundingClientRect().width]);
|
||||
expect(barWidth).toBeLessThan(rowWidth / 2);
|
||||
});
|
||||
@@ -9,7 +9,8 @@
|
||||
.rp-tabbar {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-self: flex-start;
|
||||
/* A grid item: justify-self keeps the bar as wide as its tabs instead of the row. */
|
||||
justify-self: start;
|
||||
max-width: 100%;
|
||||
/* More tabs than a phone is wide scroll within the bar, not the page; the slider scrolls with them. */
|
||||
overflow-x: auto;
|
||||
|
||||
Reference in new issue
Block a user