Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2137] Show disabled pseudo-checkbox for actions #1056

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

jiromaykin
Copy link
Contributor

@jiromaykin jiromaykin commented Feb 26, 2024

Issue: https://taiga.maykinmedia.nl/project/open-inwoner/issue/2137
To explicitly show required-actions notifications cannot be turned off (on http://localhost:8000/mijn-profiel/notificaties/).

➕ also making the pseudo checkbox accessible (⚠️ ordinary disabled inputs are not detected by screenreaders and are not read + cannot be focussed, so making a visual fake checkbox here that actually gets detected).
A disabled input that cannot be enabled by the user in any way is a violation of accessibility.

@jiromaykin jiromaykin marked this pull request as ready for review February 26, 2024 15:21
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.92%. Comparing base (2d1e090) to head (17c86c4).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1056   +/-   ##
========================================
  Coverage    94.92%   94.92%           
========================================
  Files          881      881           
  Lines        30863    30863           
========================================
  Hits         29298    29298           
  Misses        1565     1565           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jiromaykin jiromaykin force-pushed the feature/2137-pseudo-checkbox-profile-notifications branch from 17c86c4 to ac958a7 Compare February 26, 2024 17:26
{% autorender_field form field %}
{% endfor %}

<div class="form__control">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could move this disabled checkbox to a separate template that can be included, to avoid duplication.

Also, is there a reason why this is a <span role="checkbox"> and not an <input type="checkbox" disabled>?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not make a reusable template for bad patterns such as actual disabled inputs that cannot be enabled by the user, as I explained in the description of this PR above - also: new designs are coming soon and this PR is an intermediate change.
Also: yes, this should not be an actual input tag, because accessibility devices completely ignore disabled inputs and do not give any textual/label information.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check, didn't know that 👍

@stevenbal stevenbal self-requested a review February 27, 2024 15:13
{# pseudo checkbox for notifications that cannot be disabled #}
<div class="checkbox">
<span role="checkbox" aria-disabled="true" aria-checked="true" class="checkbox__input checkbox__pseudo checkbox__input--disabled" aria-labelledby="id_cases_notifications_action_required" tabindex="0"></span>
<span class="checkbox__label checkbox__pseudo-label" id="id_cases_notifications_action_required">{% trans "Zaaknotificaties - action required" %}</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{% trans "Zaaknotificaties - action required" %} is a mix of Dutch and English (should have been cleaned up as part of my PR).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess I should make it all in Dutch (including the paragraph)?
(We have new translations for this one now I can use)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, client-facing text should be Dutch, preferably. It will be translated anyways, but this will make it easier and more consistent.

@jiromaykin jiromaykin force-pushed the feature/2137-pseudo-checkbox-profile-notifications branch from ac958a7 to 15fb014 Compare February 27, 2024 15:33
@alextreme alextreme merged commit d11a962 into develop Feb 27, 2024
15 checks passed
@alextreme alextreme deleted the feature/2137-pseudo-checkbox-profile-notifications branch February 27, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants