-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document no href in link #374
Comments
@MelSumner Pinging you to ask if this is an a11y issue? |
Does the addon render a |
@Alonski yes, it is. If it goes to a URL, it should be a link. If it toggles something, submits a form, etc, then it should be a button. |
Yes only a documentation issue. Even if the tag has |
I just checked the documentation of the link-href-attributes rule. Maybe we should use |
@gilest Using a button generates an assert error for invalid tag type. Our link was stylized as a button so that was the first thing I tried. The assert is in if (DEBUG) {
const VALID_TAGS = ['a', 'abbr', 'area', 'audio', 'b', 'bdo', 'br', 'canvas',
'cite', 'circle', 'clipPath', 'code', 'command', 'datalist', 'del', 'dfn',
'em', 'embed', 'i', 'iframe', 'img', 'kbd', 'line', 'mark', 'mask', 'math',
'noscript', 'object', 'q', 'radialGradient', 'rect', 'ruby', 'samp',
'script', 'small', 'span', 'strong', 'sub', 'sup', 'svg', 'time', 'var',
'video', 'wbr', 'path', 'polygon', 'polyline',
'g', 'use'];
component.reopen({
didInsertElement() {
let id = get(this, 'for');
assert(`Changing the tagName of FileUpload to "${get(this, 'tagName')}" will break interactions.`, get(this, 'tagName') === 'label');
let elements = this.element.querySelectorAll('*');
for (let i = 0; i < elements.length; i++){
let element = elements[i];
if (element.id !== id &&
VALID_TAGS.indexOf(element.tagName.toLowerCase()) === -1) {
assert(`"${element.outerHTML}" is not allowed as a child of FileUpload.`);
}
}
}
})
} |
I think 🤔 it was to stop developers from putting block elements inside of the I had a quick look on MDN and:
Let's reconsider the markup of this addon entirely so that it meets modern HTML and accessibility standards ✅ |
@maximilianmeier I don't see a reason why |
I use a span with role="button". but my first choice was button which is not available |
I don't see any problems with the button tag on first sight |
I used span role=button approach as well while fixing template lint errors. |
+1 should be able to use button, also ran into this recently! |
In v5 we are deprecating the component in favour of a modifier. See the Upgrade guide here. Feedback appreciated. |
Should be resolved by v5 |
The latest template linter has a rule requiring
<a>
tags have ahref
which breaks fileUpload. It's a pretty subtle error and if you don't test your upload function you will probably ship a bug to production 🤦This should be documented along with how to disable the linting rule in the template file.
{{!-- template-lint-disable link-href-attributes --}}
The text was updated successfully, but these errors were encountered: