Skip to content

Commit e1f2752

Browse files
authored
Merge pull request #505 from ProgressPlanner/ari/a11y-fix-for-todos-label
a11y fix
2 parents 64c1225 + 2c53ba5 commit e1f2752

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
= 1.5.0 =
22

3+
Added these recommendations from Ravi:
4+
5+
* [Test if your website can send emails correctly](https://prpl.fyi/troubleshoot-smtp).
6+
37
Bugs we fixed:
48

59
* Don't redirect user to Progress Planner dashboard if 'redirect_to' GET or POST parameter is set.
610
* Removed the Onboard tour steps for the Settings popover which was removed in 1.3.0.
711
* Fixed detecting creation of new valuable content posts.
812
* Don't award point for all Todo tasks, only for golden.
13+
* Fix Todo task title not being editable.
914

1015
= 1.4.2 =
1116

assets/js/web-components/prpl-suggested-task.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,15 @@ customElements.define(
217217
<slot name="open-icon">`;
218218
}
219219

220-
output += `<input
220+
output += `<label><input
221221
type="checkbox"
222-
id="prpl-suggested-task-checkbox-${ task_id }"
223222
class="prpl-suggested-task-checkbox"
224223
style="${ checkboxStyle }"
225224
${ ! dismissable ? 'disabled' : '' }
226225
${ getTaskStatus() === 'completed' ? 'checked' : '' }
227-
>`;
226+
><span class="screen-reader-text">${ taskHeading }: ${ prplL10n(
227+
'markAsComplete'
228+
) }</span></label>`;
228229

229230
if ( ! dismissable ) {
230231
output += `
@@ -260,17 +261,11 @@ customElements.define(
260261
>
261262
${ actionButtons.completeCheckbox }
262263
<h3 style="width: 100%;">
263-
${
264-
useCheckbox
265-
? `<label for="prpl-suggested-task-checkbox-${ task_id }">`
266-
: ''
267-
}
268264
<span${
269265
'user' === category
270266
? ` contenteditable="plaintext-only"`
271267
: ''
272268
}>${ taskHeading }</span>
273-
${ useCheckbox && dismissable ? `</label>` : '' }
274269
</h3>
275270
<div class="prpl-suggested-task-actions">
276271
<div class="tooltip-actions">
@@ -482,6 +477,12 @@ customElements.define(
482477
detail: { node: thisObj },
483478
} )
484479
);
480+
481+
h3Span
482+
.closest( '.prpl-suggested-task' )
483+
.querySelector(
484+
'label:has(.prpl-suggested-task-checkbox) .screen-reader-text'
485+
).innerHTML = title;
485486
} );
486487
}, 300 );
487488
} );

tests/e2e/constants/selectors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
const SELECTORS = {
6-
RR_ITEM_TEXT: 'h3 > label > span',
6+
RR_ITEM_TEXT: 'h3 > span',
77
TODO_ITEM: 'ul#todo-list > prpl-suggested-task li',
88
TODO_COMPLETED_ITEM: 'ul#todo-list-completed > prpl-suggested-task li',
99
TODO_LIST: 'ul#todo-list',

0 commit comments

Comments
 (0)