Skip to content

Commit

Permalink
fix(Tree): expand action area should not shrink when the content is o…
Browse files Browse the repository at this point in the history
…versize, close #4689 (#4723)

* fix(Tree): [Tree] content whit long text align-right issue, close #4689

* chore(Tree): remove unnecessary css specificity  close #4689

* chore(Tree): ret test code,close #4689

* chore(Tree): update test code ,close #4689

---------

Co-authored-by: lancely <wb-lh589421@alibaba-inc.com>
  • Loading branch information
seven-lh and lancely authored Jan 24, 2024
1 parent 4ad6511 commit 157835f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions components/tree/__tests__/index-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,21 @@ describe('Tree', () => {
assertTree({ children: loop(dataSource), dataSource }, mountNode);
});

it('should switcher ignore flex when node is long text', () => {
ReactDOM.render(
<Tree
selectable={false}
isLabelBlock
defaultExpandedKeys={['0-0', '0-0-0', '0-0-0-0']}
>
<TreeNode key="2" className="long-text-node" label={<div style={{width: '200vw'}}>long text</div>} />
</Tree>,
mountNode
);
const switcher = document.querySelector('.long-text-node .next-tree-switcher');
assert(switcher && switcher.clientWidth);
});

it('should ignore children contain null or string', () => {
ReactDOM.render(
<Tree checkable editable defaultExpandAll defaultSelectedKeys={['1']} defaultCheckedKeys={['3']}>
Expand Down
1 change: 1 addition & 0 deletions components/tree/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
}

&-switcher.#{$css-prefix}noop-noline {
flex: none;
width: $tree-switch-arrow-size;
height: $tree-switch-arrow-size;
}
Expand Down

0 comments on commit 157835f

Please sign in to comment.