Quick Start Guide | |
---|---|
What You Will Need | SpreadJS, Visual Studio Code |
Controls Referenced | |
Tutorial Concept | JavaScript Accessibility Support - Adding features to make your web application compliant with accessibility standards. This tutorial will use SpreadJS to make a JavaScript spreadsheet application. |
Accessibility and Section 503 Compliance in apps are a requirement for many different companies, so it is important to make sure your application has accessibility options in it. With SpreadJS, a JavaScript spreadsheet, you can set different accessibility options to help make your applications compliant when presenting data within the spreadsheet. This blog will go over the different accessibility options that you can set in the spreadsheet and what they do.
- Screen Readers
- Accessibility Support
- Alternative Text
If needed, you can download a 30-day fully functional trial here to follow along with this blog.
Screen Readers
SpreadJS supports screen readers:
- NVDA for Windows
- VoiceOver for Mac
These screen readers work with different types of cells in SpreadJS in addition to basic text and number cells. These cells include:
- Buttons - Reads as “Cell (cell reference, i.e. A1) has button (button name)”
- Checkboxes - Reads as “Cell (cell reference, i.e. A1) has checkbox (checkbox name)”
- Links - Reads as “Cell (cell reference, i.e. A1) has hyperlink (hyperlink name)”
Accessibility Support
To get started with adding accessibility, the option must be set to true:
This can also be enabled in the SpreadJS Designer using the Settings>General window:
It should be noted that enabling this option does not affect the performance of SpreadJS.
In addition to traditional spreadsheet navigation, you can also interact with the context menus of headers as well, such as a filter on the column. This can be done through a keyboard shortcut with the following code:
Alternative Text
SpreadJS supports using alternative text for cells. This is descriptive text that helps users with disabilities and those who are using screen readers to interact with cells. If the alt text is set for a cell, the screen reader will read the alt text out loud. Alt text supports plain text in addition to placeholders, such as “{value}” for cell values and {formatted} for formatted cell values.
Alt text can be set, viewed, copied, moved, and modified, and they are supported in serialization and deserialization for .SSJSON or .SJS file formats. There are a few different ways that you can set alt text:
- getAltText and setAltText methods of the Worksheet class:
- altText method of the CellRange class:
- altText option of the StorageType enumeration:
- altText option of the CopyToOptions enumeration:
You can also set altText using the UI by right-clicking on a cell:
The altText feature also allows you to create custom alternative text for cells, which is especially useful for custom fonts and icons within a cell. You can manually control what the screen reader will read aloud for specific cells.
In addition to cells, you can set custom alternative text for pictures, shapes, and charts. This can be done just using the “alt” method for the following classes:
- Picture
- FloatingObject
- ConnectorShape
- GroupShape
- Shape
- Chart
This can be done with the following code:
These are just a few of the accessibility options that are available in SpreadJS. We are continuously working with customers and adding more accessibility features to ensure apps are compliant. If you have any accessibility requirements you’d like to see implemented, don’t hesitate to reach out to our support team here!
Ready to Check it Out? Download a 30-day Free Trial of SpreadJS Today!