GCWeb icon indicating copy to clipboard operation
GCWeb copied to clipboard

Page feedback tool: Polish AJAX fragments (FR pageData, role="status")

Open EricDunsworth opened this issue 7 months ago • 5 comments

The AJAX fragments had two minor flaws:

  • The English fragment contained pageData references that were missing from the French variant. That difference caused a hidden input named "contact" (with a JSON string as its value) to be injected into French feedback widgets. Although it didn't cause any other issues (data-feedback-link and data-feedback-url still worked fine in practice).
  • The no button's invisible transition message in JS mode is technically a status message, but wasn't coded as such (was using aria-live="polite" as opposed to role="status").

This resolves the flaws by:

  • Adding pageData references throughout the French fragment (same spots as English) to eliminate the hidden "contact" input.
  • Replacing aria-live="polite" with role="status" in the no button's transition message:
    • role="status" is a more formal way of denoting status messages, implicitly sets aria-live="polite" + aria-atomic="true" and is already in use for the widget's thank you message.

EricDunsworth avatar Jul 16 '24 22:07 EricDunsworth