mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +08:00
fix: 🐛 Typography title prop support (#24440)
This commit is contained in:
parent
f0a4e211b1
commit
84bd53627b
@ -407,7 +407,6 @@ class Base extends React.Component<InternalBlockProps & ConfigConsumerProps, Bas
|
||||
type,
|
||||
disabled,
|
||||
style,
|
||||
title,
|
||||
...restProps
|
||||
} = this.props;
|
||||
const { rows, suffix } = this.getEllipsis();
|
||||
@ -435,6 +434,7 @@ class Base extends React.Component<InternalBlockProps & ConfigConsumerProps, Bas
|
||||
|
||||
// Only use js ellipsis when css ellipsis not support
|
||||
if (rows && isEllipsis && !expanded && !cssEllipsis) {
|
||||
const { title } = restProps;
|
||||
ariaLabel = title;
|
||||
if (!title && (typeof children === 'string' || typeof children === 'number')) {
|
||||
ariaLabel = String(children);
|
||||
|
@ -634,6 +634,7 @@ exports[`renders ./components/typography/demo/suffix.md correctly 1`] = `
|
||||
</div>
|
||||
<div
|
||||
class="ant-typography ant-typography-ellipsis"
|
||||
title="To be, or not to be, that is a question: Whether it is nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them? To die: to sleep; No more; and by a sleep to say we end The heart-ache and the thousand natural shocks That flesh is heir to, 'tis a consummation Devoutly to be wish'd. To die, to sleep To sleep- perchance to dream: ay, there's the rub! For in that sleep of death what dreams may come When we have shuffled off this mortal coil, Must give us pause. There 's the respect That makes calamity of so long life--William Shakespeare"
|
||||
>
|
||||
To be, or not to be, that is a question: Whether it is nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them? To die: to sleep; No more; and by a sleep to say we end The heart-ache and the thousand natural shocks That flesh is heir to, 'tis a consummation Devoutly to be wish'd. To die, to sleep To sleep- perchance to dream: ay, there's the rub! For in that sleep of death what dreams may come When we have shuffled off this mortal coil, Must give us pause. There 's the respect That makes calamity of so long life--William Shakespeare
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user