Skip to content

Commit

Permalink
fix: table and list to hide scroll bar is no overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
matthprost committed Dec 16, 2024
1 parent 9d056b3 commit 27dfa74
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 49 deletions.
5 changes: 5 additions & 0 deletions .changeset/dry-cats-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ultraviolet/ui": patch
---

Hide scroll bar on `Table` and `List` if there is no overflow on x
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ exports[`List > Should expand a row by pressing Space 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -708,12 +708,12 @@ exports[`List > Should not collapse a row by clicking on expandable content 1`]
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -1462,7 +1462,7 @@ exports[`List > Should render correctly 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -2001,12 +2001,12 @@ exports[`List > Should render correctly with bad sort value 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -2694,7 +2694,7 @@ exports[`List > Should render correctly with disabled rows 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -3243,7 +3243,7 @@ exports[`List > Should render correctly with expandable rows 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -3802,12 +3802,12 @@ exports[`List > Should render correctly with info 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -4602,12 +4602,12 @@ exports[`List > Should render correctly with isExpandable and autoClose rows the
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -5356,12 +5356,12 @@ exports[`List > Should render correctly with isExpandable rows then click 1`] =
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -6079,7 +6079,7 @@ exports[`List > Should render correctly with loading 1`] = `
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -6810,7 +6810,7 @@ exports[`List > Should render correctly with loading with selectable 1`] = `
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -7901,12 +7901,12 @@ exports[`List > Should render correctly with preventClick cell then click but ev
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -8594,7 +8594,7 @@ exports[`List > Should render correctly with row expanded 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -9133,7 +9133,7 @@ exports[`List > Should render correctly with selectable 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -10783,12 +10783,12 @@ exports[`List > Should render correctly with selectable then click on first row
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -13048,12 +13048,12 @@ exports[`List > Should render correctly with selectable with shift click for mul
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -15311,7 +15311,7 @@ exports[`List > Should render correctly with sentiment rows 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -15865,7 +15865,7 @@ exports[`List > Should render correctly with sort 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -16404,12 +16404,12 @@ exports[`List > Should render correctly with sort then click 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { ColumnProps } from './types'

const TableContainer = styled.div`
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
`

const StyledTable = styled.table`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`Table > Should render correctly 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -491,12 +491,12 @@ exports[`Table > Should render correctly with bad sort value 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -1098,12 +1098,12 @@ exports[`Table > Should render correctly with highlight animation on Table.Row 1
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -1679,12 +1679,12 @@ exports[`Table > Should render correctly with info 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -2265,7 +2265,7 @@ exports[`Table > Should render correctly with loading 1`] = `
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -2904,12 +2904,12 @@ exports[`Table > Should render correctly with selectDisabled as a string 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -3501,12 +3501,12 @@ exports[`Table > Should render correctly with selectable and shift click 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -5164,12 +5164,12 @@ exports[`Table > Should render correctly with selectable then click on first row
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -6829,12 +6829,12 @@ exports[`Table > Should render correctly with sort then click 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down Expand Up @@ -7561,12 +7561,12 @@ exports[`Table > Should render correctly with stipped 1`] = `
<DocumentFragment>
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-0 {
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
}
.emotion-2 {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type { ColumnProps } from './types'

const TableContainer = styled.div`
min-width: 100%;
overflow-x: scroll;
overflow-x: auto;
`

type StyledTableProps = {
Expand Down

0 comments on commit 27dfa74

Please sign in to comment.