mirror of
https://github.com/penpot/penpot.git
synced 2025-07-30 01:57:21 +02:00
✨ Improve dashboard accessibility
This commit is contained in:
parent
2ce36ce052
commit
7045496a39
28 changed files with 761 additions and 283 deletions
|
@ -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]]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue