简体   繁体   中英

JAWS not switching to form mode when form loaded via AJAX

I have a form, loaded into a modal via AJAX. When the form has loaded and I either tab to the first form text input or set focus to it with JS, JAWS doesn't switch into forms mode, and therefore I can't enter text in the form fields or press Enter on the submit button to submit. When I try to type, JAWS is still in document mode, so it uses the keyboard quick keys to jump around the page.

My markup validates (I can share if needed).

Am I missing something obvious?

In case anyone else suffers the same - the issue was caused by aria-hidden="true" being added to a parent further up the DOM when a modal was opened (originally added to prevent keyboard navigation to elements behind the modal). Removing that, and adding some extra code to trap keyboard focus within the modal and everything works as it should.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM