- Success Criterion 1.4.4
- Conformance level AA
JavaScript Text Truncation That Deletes Content on Zoom
1.4.4 — Resize Text
Scenario
Setting
A job board's application form
What’s wrong
JS that measures text and truncates with ellipsis based on pixel budgets (content lost, no expansion).
Example
function truncateTitle(el) {
while (el.scrollWidth > 200) {
el.textContent = el.textContent.slice(0, -1);
}
el.textContent += "...";
}
<!-- characters are permanently deleted from the DOM based on a fixed pixel budget --> Why it matters
An applicant reviewing their submitted job title before sending it sees it permanently cut off and can't verify the full text they wrote.
How to test
Set zoom to 200% and check any auto-truncating text (ellipsis): if JS measures pixel width and cuts content that was previously visible, it fails.
How to fix
Use CSS text-overflow: ellipsis for a visual-only truncation, keeping the full text in the DOM and available via title or tooltip.
.job-title { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } Outcome
The applicant hovers the truncated title and confirms the full text they submitted is exactly right.
Who is affected
Low-vision users, since the actual job title text no longer exists in the page at all, not just visually hidden.
Learn more
- Understanding Understanding document (opens in a new tab)
Related scenarios
- Text and Controls That Get Cut Off at 200% Zoom
- Form Fields That Don’t Grow When Text Is Enlarged
- Font Size Set in Viewport Units That Ignores Browser Zoom
- Viewport Meta Tag That Disables Pinch-to-Zoom on Mobile
- Fixed-Height Containers That Clip Content at 200% Zoom
- Button or Nav Text That Overflows Its Fixed-Size Container