Review main Abandoned

86111[BUGFIX] Make bookmark button focusable when disabled

Sébastien Delcroix CR 0 V 0 Easy +15 −3 updated 11/10/26, 11:05

Commit message

For accessibility, UI elements a user cannot interact with, commonly
qualified by "disabled", but that are still visible to keep the UI
consistent, must be focusable.

The HTML "disabled" attribute prevents elements to be focusable.
Instead it is recommended to use the "aria-disabled" one.

This patch applies this recommandation to the bookmark button for
records. The styling mimics text and background colors of the
"disabled" attribute/class and the cursor property is set to default to
indicate that the element is not responsive.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 3

Review log 1821

  1. Sébastien Delcroix uploaded patch set 1 09/15/24, 18:37

  2. core-ci voted on patch set 1 V +1 09/15/24, 18:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65821

  3. Ayke Halder commented on patch set 1 09/15/24, 19:28

    Thanks for picking this up - it's a general point about 'disabled menu entries' which might need further elaboration/evaluation. I opened the ticket, and I'm not sure, if my proposed solution (which is implemented here) is the perfect solution. Also see https://github.com/twbs/bootstrap/issues/40564#issuecomment-2175459119

    _dropdown.scss:122

    We just need the outline here to mark the 'actively focused element'. The background can stay as-is, as the element itself still behaves like it is disabled.
  4. Sébastien Delcroix uploaded patch set 2 V +1 09/15/24, 19:56

  5. Sébastien Delcroix commented on patch set 2 09/15/24, 19:56

    _dropdown.scss:122 Reply

    Done
  6. core-ci voted on patch set 2 V +1 09/15/24, 20:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65824

  7. Sébastien Delcroix commented on patch set 2 09/16/24, 07:48

    _dropdown.scss:118

    Maybe a pointer-events: none; would be better than cursor: default;
  8. Garvin Hicking commented on patch set 2 09/16/24, 08:00

    _dropdown.scss:118 Reply

    Does https://review.typo3.org/c/Packages/TYPO3.CMS/+/86115 address the same thing, but more globally?
  9. Sébastien Delcroix commented on patch set 2 09/16/24, 08:16

    _dropdown.scss:118 Reply Unresolved

    That's the one which made me think about this change ;)
  10. Ayke Halder commented on patch set 2 CR -1 09/16/24, 09:27

    I opened the issue and I changed my opinion on the use of `aria-disabled="true"` here, as I do not have any feedback on how screenreaders other than 'ORCA' behave. Plus, while in screenreader browse-mode, `aria-disabled="true"` does only solve `tab`-navigation, but does not solve cursor-key-navigation. Also see discussion on Slack: https://typo3.slack.com/archives/C03AM9R17/p1726426097507239 ---- Maybe we could use a more general approach in this case: Current bookmark button states: * Set bookmark (active button) * Bookmark is already set (disabled button) Implement 'toggle' button instead: * Set bookmark (active button) * Remove bookmark (active button) ---- The point with `aria-disabled="true"` is, that the button is announced by screenreaders as disabled, but it is actually not disabled. So with `aria-disabled="true"` we must implement an additional JS click-handler, that stops the click action. Whereas with the `disabled`-attribute, the browser really disables the element - and even JS `click`-events are not fired anymore.
  11. Sébastien Delcroix commented on patch set 2 09/16/24, 09:33

    Reply

    On my side, I've only tested with macOS VoiceOver. The button is announced as "dimmed". Regarding the JS click-handler on this button, there's already an early return as I saw.
  12. Sébastien Delcroix commented on patch set 2 09/16/24, 09:37

    Reply

    Maybe the dropdown could also be replaced by 2 buttons, as "bookmark" is not really related to "sharing".
  13. Sébastien Delcroix commented on patch set 2 09/16/24, 10:35

    Reply Unresolved

    I'm in favor of an action 'toggle" button to set or remove bookmark.
  14. Sébastien Delcroix uploaded patch set 3 CR -1 V +1 09/16/24, 10:54

  15. core-ci voted on patch set 3 V +1 09/16/24, 11:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65880

  16. Ayke Halder commented on patch set 3 09/16/24, 12:53

    _dropdown.scss:119

    As we might go for the toggle button solution, this is not relevant in this case anymore. But in general: **Always have either border or outline as 2-3px transparent line for 'high-contrast mode' to look properly.** See e.g. https://piccalil.li/blog/use-transparent-borders-and-outlines-to-assist-with-high-contrast-mode/
  17. Sébastien Delcroix commented on patch set 3 09/16/24, 13:18

    _dropdown.scss:119 Reply

    Acknowledged
  18. Sébastien Delcroix commented on patch set 3 09/17/24, 06:02

    _dropdown.scss:122 Reply Unresolved

    Oops sorry, I think I've understood the opposite of what you said and disabled the outline instead of removing the background. This is however not relevant anymore but I wanted you to know my misunderstanding.
  19. Benni Mack updated the commit message in patch set 4 V +1 10/18/24, 13:50

  20. Benni Mack marked it work in progress 03/25/25, 12:52

  21. Benni Mack abandoned the change 11/10/26, 11:05

    already fixed with new Bookmark management, issue is already closed