Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sclower committed Oct 29, 2024
1 parent 8583e4d commit bc6d5e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/services/aria.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ class Aria {
return this.clear();
}

/* Clear out the internal alert message queue.
* If opts.emptyContent is set, also clear the rendered text content for the alert element (typically when the focused field has been blurred) so we don't leave stale alert text hanging around. */
clear(opts?: { emptyContent: boolean }) {
this.items.length = 0;
if (opts?.emptyContent) this.span.textContent = '';
Expand Down
2 changes: 1 addition & 1 deletion src/services/textarea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class Controller extends Controller_scrollHoriz {
? ariaLabel + ':'
: ariaLabel;
var mathspeak = ctrlr.root.mathspeak().trim();
const emptyContent = !!opts?.emptyContent;
const emptyContent = !!opts?.emptyContent; // Set when the focused field has been blurred so alert text is removed when it's no longer needed.
this.aria.clear({ emptyContent });

if (!!ctrlr.mathspeakSpan) {
Expand Down

0 comments on commit bc6d5e6

Please sign in to comment.