Skip to content

Commit

Permalink
New: Add event trigger (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-replin authored Apr 27, 2023
1 parent 657991d commit a5a9e8f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions templates/Visua11ySettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ export default function Visua11ySettings(config) {
}

function onChange(event) {
let state;
const { name, checked, value, type } = event.target;
visua11y[name] = type === 'checkbox' ? checked : value;
if (type === 'checkbox') { state = checked; }
if (type === 'radio' || type === 'select-one') { state = value; }
Adapt.trigger('visua11y:toggle', name, state);
}

return (
Expand Down

0 comments on commit a5a9e8f

Please sign in to comment.