Skip to content

Commit

Permalink
fix(tree): the height attribute does not work (#3717)
Browse files Browse the repository at this point in the history
* fix(tree): the height attribute does not work

* test(tree): the height attribute does not work
  • Loading branch information
betavs authored Dec 10, 2023
1 parent 9fdcf45 commit 69f2288
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/tree/hooks/useTreeStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default function useTreeStyles(state: TypeTreeState) {
const treeContentStyles = computed<TypeStyles>(() => ({
height: formatCSSUnit(height.value),
maxHeight: formatCSSUnit(maxHeight.value),
overflowY: formatCSSUnit(height.value) || formatCSSUnit(maxHeight.value) ? 'auto' : undefined,
}));

const scrollStyles = computed<TypeStyles>(() => {
Expand Down
6 changes: 3 additions & 3 deletions test/unit/snap/__snapshots__/csr.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -187417,7 +187417,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/debug-vscroll.vue 1`]
>
<div
class="t-tree t-tree--hoverable t-tree--checkable t-tree--transition"
style="height: 300px;"
style="height: 300px; overflow-y: auto;"
>
<!---->
<div
Expand Down Expand Up @@ -196687,7 +196687,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/vscroll.vue 1`] = `
>
<div
class="t-tree t-tree--hoverable t-tree--checkable t-tree--transition t-tree__vscroll"
style="height: 300px;"
style="height: 300px; overflow-y: auto;"
>
<div
class="t-tree__vscroll-cursor"
Expand Down Expand Up @@ -199370,7 +199370,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/vscroll-lazy.vue 1`] =
>
<div
class="t-tree t-tree--hoverable t-tree--transition t-tree__lazyload"
style="height: 300px;"
style="height: 300px; overflow-y: auto;"
>
<!---->
<transition-group-stub
Expand Down
Loading

0 comments on commit 69f2288

Please sign in to comment.