mirror of
https://github.com/flarum/framework.git
synced 2025-02-06 14:37:14 +08:00
parent
b3019e72fe
commit
1702929079
|
@ -29,6 +29,12 @@ export default class Button extends Component {
|
|||
attrs.className = attrs.className || '';
|
||||
attrs.type = attrs.type || 'button';
|
||||
|
||||
// If a tooltip was provided for buttons without additional content, we also
|
||||
// use this tooltip as text for screen readers
|
||||
if (attrs.title && !this.props.children) {
|
||||
attrs['aria-label'] = attrs.title;
|
||||
}
|
||||
|
||||
// If nothing else is provided, we use the textual button content as tooltip
|
||||
if (!attrs.title && this.props.children) {
|
||||
attrs.title = extractText(this.props.children);
|
||||
|
|
Loading…
Reference in New Issue
Block a user