Skip to content

Commit fdde543

Browse files
authored
Merge pull request #176 from PublicisSapient/ticket/36-switch-aria-described-by-unexistant-id
(#36) Switch aria-describedby pointing to unexistant ID
2 parents 6b7736c + f7f8c1d commit fdde543

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

js/modules/es4/switch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const Switch = new (function() {
2323

2424
this.onClick = (evt) => {
2525
let el = evt.target;
26-
const id = el.id;
26+
const id = el.id.split('-')[0];
2727
const switchEl = el.closest('[role="switch"]');
2828
let ariaDescribedBy;
2929
let isChecked;
@@ -59,4 +59,4 @@ const Switch = new (function() {
5959
);
6060
}
6161
}
62-
})
62+
})

js/modules/switch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const Switch = new function () {
2323

2424
this.onClick = (evt) => {
2525
let el = evt.target;
26-
const id = el.id;
26+
const id = el.id.split('-')[0];
2727
const switchEl = el.closest('[role="switch"]');
2828
let ariaDescribedBy;
2929
let isChecked;
@@ -62,4 +62,4 @@ const Switch = new function () {
6262
}
6363

6464

65-
export default Switch;
65+
export default Switch;

0 commit comments

Comments
 (0)