mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
Ellipsis onExpand function takes event parameter (#22092)
This commit is contained in:
parent
145f72741b
commit
c8f437ea02
@ -40,7 +40,7 @@ interface EllipsisConfig {
|
|||||||
rows?: number;
|
rows?: number;
|
||||||
expandable?: boolean;
|
expandable?: boolean;
|
||||||
suffix?: string;
|
suffix?: string;
|
||||||
onExpand?: () => void;
|
onExpand?: React.MouseEventHandler<HTMLElement>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BlockProps extends TypographyProps {
|
export interface BlockProps extends TypographyProps {
|
||||||
@ -165,13 +165,13 @@ class Base extends React.Component<InternalBlockProps & ConfigConsumerProps, Bas
|
|||||||
raf.cancel(this.rafId);
|
raf.cancel(this.rafId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// =============== Expend ===============
|
// =============== Expand ===============
|
||||||
onExpandClick = () => {
|
onExpandClick: React.MouseEventHandler<HTMLElement> = e => {
|
||||||
const { onExpand } = this.getEllipsis();
|
const { onExpand } = this.getEllipsis();
|
||||||
this.setState({ expanded: true });
|
this.setState({ expanded: true });
|
||||||
|
|
||||||
if (onExpand) {
|
if (onExpand) {
|
||||||
onExpand();
|
(onExpand as React.MouseEventHandler<HTMLElement>)(e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ Basic text writing, including headings, body text, lists, and more.
|
|||||||
| delete | Deleted line style | boolean | false | |
|
| delete | Deleted line style | boolean | false | |
|
||||||
| disabled | Disabled content | boolean | false | |
|
| disabled | Disabled content | boolean | false | |
|
||||||
| editable | Editable. Can control edit state when is object | boolean \| { editing: boolean, onStart: Function, onChange: Function(string) } | false | |
|
| editable | Editable. Can control edit state when is object | boolean \| { editing: boolean, onStart: Function, onChange: Function(string) } | false | |
|
||||||
| ellipsis | Display ellipsis when text overflows. Can configure rows and expandable by using object | boolean \| { rows: number, expandable: boolean, onExpand: Function } | false | |
|
| ellipsis | Display ellipsis when text overflows. Can configure rows and expandable by using object | boolean \| { rows: number, expandable: boolean, onExpand: Function(event) } | false | |
|
||||||
| level | Set content importance. Match with `h1`, `h2`, `h3`, `h4` | number: `1`, `2`, `3`, `4` | 1 | |
|
| level | Set content importance. Match with `h1`, `h2`, `h3`, `h4` | number: `1`, `2`, `3`, `4` | 1 | |
|
||||||
| mark | Marked style | boolean | false | |
|
| mark | Marked style | boolean | false | |
|
||||||
| underline | Underlined style | boolean | false | |
|
| underline | Underlined style | boolean | false | |
|
||||||
@ -55,7 +55,7 @@ Basic text writing, including headings, body text, lists, and more.
|
|||||||
| delete | Deleted line style | boolean | false | |
|
| delete | Deleted line style | boolean | false | |
|
||||||
| disabled | Disabled content | boolean | false | |
|
| disabled | Disabled content | boolean | false | |
|
||||||
| editable | Editable. Can control edit state when is object | boolean \| { editing: boolean, onStart: Function, onChange: Function(string) } | false | |
|
| editable | Editable. Can control edit state when is object | boolean \| { editing: boolean, onStart: Function, onChange: Function(string) } | false | |
|
||||||
| ellipsis | Display ellipsis when text overflows. Can configure rows expandable and suffix by using object | boolean \| { rows: number, expandable: boolean suffix: string, onExpand: Function } | false | |
|
| ellipsis | Display ellipsis when text overflows. Can configure rows expandable and suffix by using object | boolean \| { rows: number, expandable: boolean suffix: string, onExpand: Function(event) } | false | |
|
||||||
| mark | Marked style | boolean | false | |
|
| mark | Marked style | boolean | false | |
|
||||||
| underline | Underlined style | boolean | false | |
|
| underline | Underlined style | boolean | false | |
|
||||||
| onChange | Trigger when user edits the content | Function(string) | - | |
|
| onChange | Trigger when user edits the content | Function(string) | - | |
|
||||||
|
Loading…
Reference in New Issue
Block a user