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

Add aria-label to drop-down currency fields #115

Open
OldNGreyBMR opened this issue Apr 1, 2022 · 2 comments
Open

Add aria-label to drop-down currency fields #115

OldNGreyBMR opened this issue Apr 1, 2022 · 2 comments
Labels
question A question about the template

Comments

@OldNGreyBMR
Copy link

For improved WCAG compliance I added an aria-label to the currency field drop down.

includes\classes\observers\ZcaBootstrapObserver.php line 197 was

        case 'NOTIFY_ZEN_DRAW_PULL_DOWN_MENU':
            $field = $p2;
            if (strpos($field, 'class="') !== false) {
                $field = str_replace('class="', 'class="custom-select', $field);
            } else {
                $field = str_replace('<select ', '<select class="custom-select" ', $field);
            }
            $p2 = $field;
            break;

changed to

 case 'NOTIFY_ZEN_DRAW_PULL_DOWN_MENU':
            $field = $p2;
            $arialabel = 'aria-label="'.$p1["name"] .'"'; 
            if (strpos($field, 'class="') !== false) {
                $arialabel2 = ' class="custom-select' . $arialabel ;
                $field = str_replace('class="', $arialabel2, $field);
            } else {
                $arialabel3 =  '<select class="custom-select" ' .$arialabel; 
                $field = str_replace('<select ', $arialabel3, $field);
            }
            $p2 = $field;
            break;

@lat9 lat9 added the bug Something isn't working label Apr 3, 2022
@lat9 lat9 added this to the v3.3.0 milestone Apr 3, 2022
@lat9
Copy link
Owner

lat9 commented Apr 3, 2022

Hmm, that simply adds an aria-label="{name of the dropdown}", not a real name. Shouldn't the dropdown(s) be preceded by a <label>, possibly with a sr-only class so that they're not displayed in non-reader mode?

@lat9 lat9 removed this from the v3.3.0 milestone Apr 3, 2022
@lat9 lat9 added question A question about the template and removed bug Something isn't working labels Apr 3, 2022
@OldNGreyBMR
Copy link
Author

OldNGreyBMR commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question about the template
Projects
None yet
Development

No branches or pull requests

2 participants