"Unable to save settings – please check your input" error lacks ARIA live region in cPanel Preferences panel
0 reputation · 26 Apr 2024, 11:35 UTC
0 reputation · 26 Apr 2024, 11:35 UTC
When a user activates the Accessibility Settings toggle in the cPanel Preferences panel using a mouse, the interface displays the inline validation message Unable to save settings – please check your input. This message is rendered without role="alert" or aria-live attributes, so screen readers do not announce it. The same error text appears consistently in cPanel 102.x and 103.x releases.
In addition, keyboard navigation via the Tab key frequently skips the Accessibility Settings control entirely, preventing keyboard-only and screen-reader users from reaching the toggle in the first place.
whmapi1) provides a functional fallback, but the web‑based workflow remains incomplete for assistive-technology users.What is the recommended approach to add a live region to the existing validation message without breaking plugin dependencies? How should the focus order be corrected so the Accessibility Settings toggle receives keyboard focus reliably? Are there documented patterns in the cPanel codebase for retrofitting ARIA attributes to legacy inline errors?
32275 reputation · 26 Apr 2024, 18:07 UTC
To make the inline validation message announced by screen readers and ensure the Accessibility Settings toggle receives keyboard focus, follow the steps below. First, determine whether the error message is rendered server‑side (in a template) or injected via JavaScript; this decides where to add the ARIA attributes.
/usr/local/cpanel/base/frontend/paper_lantern/templates/ or the equivalent path for your theme).Unable to save settings – please check your input (often a <div> or <span> with a class like alert-message).<div role="alert" aria-live="assertive">Unable to save settings – please check your input</div>.cPanel.notifications.showError or a custom helper that builds a DOM node).var msg = document.createElement('div');
msg.textContent = 'Unable to save settings – please check your input';
msg.setAttribute('role', 'alert');
msg.setAttribute('aria-live', 'assertive');
container.appendChild(msg);
const observer = new MutationObserver(mutations => { mutations.forEach(m => { m.addedNodes.forEach(node => { if (node.nodeType === 1 && node.textContent.includes('Unable to save settings')) { node.setAttribute('role', 'alert'); node.setAttribute('aria-live', 'assertive'); } }); });});observer.observe(document.body, { childList: true, subtree: true });<button>, <input type="checkbox">, or <a>) or has tabindex="0" if it is a custom <div>.pointer-events:none or display:none on the toggle or its ancestors.tabindex that skips the toggle; if found, adjust to tabindex="0" or remove it.toggleEl.focus()).The cPanel codebase already provides a notification API that creates accessible alerts:
cPanel.notifications.showError(message) – internally creates a <div role="alert"> element.cPanel.ui.Button and cPanel.ui.Checkbox automatically set appropriate tabindex and ARIA attributes.role="alert" and/or aria-live="assertive".To finalize the recommendation, please confirm whether the Unable to save settings – please check your input message is generated server‑side (in a template) or injected via JavaScript. This determines whether you should edit the template file or modify the JavaScript notification path.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.