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

Improve accessibility by associating for with id instead of name #230

Merged
merged 3 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docassemble/ALToolbox/ThreePartsDate.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,16 @@
* @returns undefined
*/
var $col = $('<div class="col col-3 col-' + type + '">');
var id = date_id + '_' + type;
// '_ignore' prevents the field from being submitted, avoiding a da error
let name = '_ignore_' + id;
var id = '_ignore_' + date_id + '_' + type;
// '_ignore' in the name prevents the field from being submitted, avoiding a da error
let name = id;

// For python formatting, need to have {{day}} and {{year}}
let $label = '';
if (type === 'day') {{
$label = $('<label for="' + name + '">{day}</label>');
$label = $('<label for="' + id + '">{day}</label>');
}} else {{
$label = $('<label for="' + name + '">{year}</label>');
$label = $('<label for="' + id + '">{year}</label>');
}}
$col.append($label);

Expand Down Expand Up @@ -175,11 +175,11 @@
*/
var $col = $('<div class="col col-month">');

let id = date_id + '_month';
// '_ignore' prevents the field from being submitted, avoiding a da error
let name = '_ignore_' + id;
let id = '_ignore_' + date_id + '_month';
// '_ignore' in the name prevents the field from being submitted, avoiding a da error
let name = id;

let $label = $('<label for="' + name + '">{month}</label>');
let $label = $('<label for="' + id + '">{month}</label>');
$col.append($label);

// aria-describedby is ok to have, even when the date-part error is
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def find_package_data(where='.', package='', exclude=standard_exclude, exclude_d
url='https://suffolklitlab.org/docassemble-AssemblyLine-documentation/docs/framework/altoolbox',
packages=find_packages(),
namespace_packages=['docassemble'],
install_requires=['holidays>=0.25', 'pandas>=2.0.3'],
install_requires=['holidays>=0.27.1', 'pandas>=2.0.3'],
zip_safe=False,
package_data=find_package_data(where='docassemble/ALToolbox/', package='docassemble.ALToolbox'),
)
Expand Down