Skip to content

Commit 1ea23ae

Browse files
committed
remove aria-hidden from focusable elements as suggested by lighthouse
1 parent 3954d61 commit 1ea23ae

10 files changed

Lines changed: 21 additions & 31 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 4.31.2
4+
5+
- Remove `aria-hidden` from drop label as suggested by Lighthouse.
6+
- Fix `tabIndex` attribute on credits link not set correctly, now no longer included in tab flow.
7+
38
## 4.31.1
49

510
- Fix issue with dragging file items sometimes not working.

dist/filepond.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* FilePond 4.31.1
2+
* FilePond 4.31.2
33
* Licensed under MIT, https://opensource.org/licenses/MIT/
44
* Please visit https://pqina.nl/filepond/ for details.
55
*/

dist/filepond.esm.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* FilePond 4.31.1
2+
* FilePond 4.31.2
33
* Licensed under MIT, https://opensource.org/licenses/MIT/
44
* Please visit https://pqina.nl/filepond/ for details.
55
*/
@@ -6957,9 +6957,6 @@ const create$b = ({ root, props }) => {
69576957
// use for labeling file input (aria-labelledby on file input)
69586958
attr(label, 'id', `filepond--drop-label-${props.id}`);
69596959

6960-
// hide the label for screenreaders, the input element will read the contents of the label when it's focussed. If we don't set aria-hidden the screenreader will also navigate the contents of the label separately from the input.
6961-
attr(label, 'aria-hidden', 'true');
6962-
69636960
// handle keys
69646961
root.ref.handleKeyDown = e => {
69656962
const isActivationKey = e.keyCode === Key.ENTER || e.keyCode === Key.SPACE;
@@ -8064,9 +8061,8 @@ const create$e = ({ root, props }) => {
80648061
if (hasCredits) {
80658062
const frag = document.createElement('a');
80668063
frag.className = 'filepond--credits';
8067-
frag.setAttribute('aria-hidden', 'true');
80688064
frag.href = credits[0];
8069-
frag.tabindex = -1;
8065+
frag.tabIndex = -1;
80708066
frag.target = '_blank';
80718067
frag.rel = 'noopener noreferrer';
80728068
frag.textContent = credits[1];

dist/filepond.esm.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/filepond.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* FilePond 4.31.1
2+
* FilePond 4.31.2
33
* Licensed under MIT, https://opensource.org/licenses/MIT/
44
* Please visit https://pqina.nl/filepond/ for details.
55
*/
@@ -9612,17 +9612,13 @@
96129612
var create$b = function create(_ref) {
96139613
var root = _ref.root,
96149614
props = _ref.props;
9615-
96169615
// create the label and link it to the file browser
96179616
var label = createElement$1('label');
96189617
attr(label, 'for', 'filepond--browser-' + props.id);
96199618

96209619
// use for labeling file input (aria-labelledby on file input)
96219620
attr(label, 'id', 'filepond--drop-label-' + props.id);
96229621

9623-
// hide the label for screenreaders, the input element will read the contents of the label when it's focussed. If we don't set aria-hidden the screenreader will also navigate the contents of the label separately from the input.
9624-
attr(label, 'aria-hidden', 'true');
9625-
96269622
// handle keys
96279623
root.ref.handleKeyDown = function(e) {
96289624
var isActivationKey = e.keyCode === Key.ENTER || e.keyCode === Key.SPACE;
@@ -10864,9 +10860,8 @@
1086410860
if (hasCredits) {
1086510861
var frag = document.createElement('a');
1086610862
frag.className = 'filepond--credits';
10867-
frag.setAttribute('aria-hidden', 'true');
1086810863
frag.href = credits[0];
10869-
frag.tabindex = -1;
10864+
frag.tabIndex = -1;
1087010865
frag.target = '_blank';
1087110866
frag.rel = 'noopener noreferrer';
1087210867
frag.textContent = credits[1];

dist/filepond.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/filepond.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "filepond",
3-
"version": "4.31.1",
3+
"version": "4.31.2",
44
"description": "FilePond, Where files go to stretch their bits.",
55
"license": "MIT",
66
"author": {

src/js/app/view/dropLabel.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@ import { createElement } from '../../utils/createElement';
44
import { Key } from '../enum/Key';
55

66
const create = ({ root, props }) => {
7-
87
// create the label and link it to the file browser
98
const label = createElement('label');
109
attr(label, 'for', `filepond--browser-${props.id}`);
1110

1211
// use for labeling file input (aria-labelledby on file input)
1312
attr(label, 'id', `filepond--drop-label-${props.id}`);
1413

15-
// hide the label for screenreaders, the input element will read the contents of the label when it's focussed. If we don't set aria-hidden the screenreader will also navigate the contents of the label separately from the input.
16-
attr(label, 'aria-hidden', 'true');
17-
1814
// handle keys
1915
root.ref.handleKeyDown = e => {
2016
const isActivationKey = e.keyCode === Key.ENTER || e.keyCode === Key.SPACE;
@@ -27,7 +23,6 @@ const create = ({ root, props }) => {
2723
};
2824

2925
root.ref.handleClick = e => {
30-
3126
const isLabelClick = e.target === label || label.contains(e.target);
3227

3328
// don't want to click twice
@@ -69,14 +64,14 @@ export const dropLabel = createView({
6964
write: createRoute({
7065
DID_SET_LABEL_IDLE: ({ root, action }) => {
7166
updateLabelValue(root.ref.label, action.value);
72-
}
67+
},
7368
}),
7469
mixins: {
7570
styles: ['opacity', 'translateX', 'translateY'],
7671
animations: {
7772
opacity: { type: 'tween', duration: 150 },
7873
translateX: 'spring',
79-
translateY: 'spring'
80-
}
81-
}
74+
translateY: 'spring',
75+
},
76+
},
8277
});

src/js/app/view/root.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,8 @@ const create = ({ root, props }) => {
104104
if (hasCredits) {
105105
const frag = document.createElement('a');
106106
frag.className = 'filepond--credits';
107-
frag.setAttribute('aria-hidden', 'true');
108107
frag.href = credits[0];
109-
frag.tabindex = -1;
108+
frag.tabIndex = -1;
110109
frag.target = '_blank';
111110
frag.rel = 'noopener noreferrer';
112111
frag.textContent = credits[1];

0 commit comments

Comments
 (0)