mirror of
https://github.com/flarum/framework.git
synced 2025-03-02 06:29:56 +08:00
parent
54f733ca80
commit
f1d9753aee
@ -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…
x
Reference in New Issue
Block a user