mirror of
https://github.com/flarum/core.git
synced 2025-08-06 16:36:47 +02:00
fix(a11y): convert empty links to buttons (#3926)
This commit is contained in:
@@ -2,6 +2,7 @@ import app from 'flarum/forum/app';
|
||||
import { extend, override } from 'flarum/common/extend';
|
||||
import IndexSidebar from 'flarum/forum/components/IndexSidebar';
|
||||
import classList from 'flarum/common/utils/classList';
|
||||
import Button from 'flarum/common/components/Button';
|
||||
|
||||
import tagsLabel from '../common/helpers/tagsLabel';
|
||||
import getSelectableTags from './utils/getSelectableTags';
|
||||
@@ -47,13 +48,16 @@ export default function addTagComposer() {
|
||||
|
||||
items.add(
|
||||
'tags',
|
||||
<a className={classList(['DiscussionComposer-changeTags', !selectableTags.length && 'disabled'])} onclick={this.chooseTags.bind(this)}>
|
||||
<Button
|
||||
className={classList(['DiscussionComposer-changeTags', 'Button Button--ua-reset', !selectableTags.length && 'disabled'])}
|
||||
onclick={this.chooseTags.bind(this)}
|
||||
>
|
||||
{tags.length ? (
|
||||
tagsLabel(tags)
|
||||
) : (
|
||||
<span className="TagLabel untagged">{app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link')}</span>
|
||||
)}
|
||||
</a>,
|
||||
</Button>,
|
||||
10
|
||||
);
|
||||
});
|
||||
|
@@ -32,6 +32,7 @@
|
||||
}
|
||||
.DiscussionComposer-changeTags {
|
||||
margin-right: 15px;
|
||||
line-height: inherit;
|
||||
|
||||
&.disabled {
|
||||
opacity: 0.5;
|
||||
|
Reference in New Issue
Block a user