Improve dashboard accessibility

This commit is contained in:
Eva 2022-11-28 08:44:19 +01:00
parent 2ce36ce052
commit 7045496a39
28 changed files with 761 additions and 283 deletions

View file

@ -9,12 +9,13 @@
[app.util.keyboard :as kbd]
[rumext.v2 :as mf]))
(mf/defc link [{:keys [action name klass data-test]}]
[:a {:on-click action
:klass klass
:on-key-down (fn [event]
(when (kbd/enter? event)
(action event)))
:tabindex "0"
:data-test data-test}
name])
(mf/defc link [{:keys [action klass data-test keyboard-action children]}]
(let [keyboard-action (or keyboard-action action)]
[:a {:on-click action
:class klass
:on-key-down (fn [event]
(when (kbd/enter? event)
(keyboard-action event)))
:tab-index "0"
:data-test data-test}
[:* children]]))