Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tree-select): label overflow #1875

Merged
merged 1 commit into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/_common
90 changes: 70 additions & 20 deletions src/dropdown/_example/multiple.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,115 @@ import { Icon } from 'tdesign-icons-react';
export default function BasicDropdown() {
const options = [
{
content: '选项一',
content: '操作一',
value: 1,
children: [
{
content: '选项九',
content: '操作九',
value: 9,
},
],
},
{
content: '选项二选项二选项二选项二',
content: '操作二操作二操作二操作二',
value: 2,
children: [
{
content: '选项五',
content: '操作五',
value: 5,
},
{
content: '选项六',
content: '操作六',
value: 6,
children: [
{
content: '选项七',
value: 7,
},
{
content: '选项八',
value: 8,
},
],
},
],
},
{
content: '选项三',
content: '操作三',
value: 3,
children: [
{
content: '选项十',
content: '操作十',
value: 10,
},
],
},
{
content: '选项四',
content: '操作四',
value: 4,
children: [
{
content: '选项十一',
content: '操作十一',
value: 11,
},
],
},
{
content: '操作五',
value: 5,
children: [
{
content: '操作十二',
value: 12,
},
],
},
{
content: '操作六',
value: 6,
children: [
{
content: '操作十三',
value: 13,
},
],
},
{
content: '操作七',
value: 7,
},
{
content: '操作八',
value: 8,
},
{
content: '操作十八',
value: 18,
children: [
{
content: '操作十四',
value: 14,
},
{
content: '操作十五',
value: 15,
},
{
content: '操作十六',
value: 16,
children: [
{
content: '三级操作一',
value: 20,
},
{
content: '三级操作二',
value: 21,
},
],
},
{
content: '操作十七',
value: 17,
},
],
},
];
const clickHandler = (data) => {
MessagePlugin.success(`选中【${data.value}】`);
};
return (
<Dropdown options={options} onClick={clickHandler}>
<Dropdown options={options} onClick={clickHandler} maxHeight={200}>
<Button theme="default" variant="outline" shape="square">
<Icon name="ellipsis" size="16" />
</Button>
Expand Down
6 changes: 6 additions & 0 deletions src/tree-select/_example/base.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ const options = [
{
label: '深圳市',
value: 'shenzhen',
children: [
{
label: '南山区海天二路33号腾讯滨海大厦',
value: 'Tencent',
},
],
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion src/tree/TreeItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const TreeItem = forwardRef((props: TreeItemProps, ref: React.Ref<HTMLDivElement
);
}
return (
<span ref={setRefCurrent} date-target="label" className={labelClasses}>
<span ref={setRefCurrent} date-target="label" className={labelClasses} title={node.label}>
<span style={{ position: 'relative' }}>{labelText}</span>
</span>
);
Expand Down