Elm app not compatible with ChromeVox screen reader

When I try to run my Elm app with ChromeVox, I see a continual stream of “Uncaught TypeError: Cannot read property ‘childNodes’ of undefined”.

What I’m guessing is I’m hitting a case similar to what is described here: i.e. it’s caused by Elm taking over the body.

Do I have any resolution to make my app compatible with screen readers?

As noted in the thread you linked, Evan appears interested in seeing a reproducible example of the problem. I imagine he’d accept a fix for this in a future version of elm/browser if there were clear examples of how the current implementation breaks (if you have some, you should open an issue against elm/browser).

As far as workarounds, if it seems like Elm controlling <body> is the problem, you could switch from Browser.application to Browser.element. (I think this was also all covered in the other thread you linked.) If you still need control of the page title and/or need to interact with navigation commands, you could do that with the help of javascript using ports. (Though depending on how much of the SPA stuff in Browser.application you were relying on, that might get to be quite a bit of extra work.)

There is also this issue:

1 Like

IMHO, this is kind of silly. As the thread explains, all other app frameworks add a div instead of using the whole body. And switching to Browser.element instead means that you have to reimplement your navigation logic with ports. The patch against the generated javascript seems much quicker to implement. And, please correct me if I am wrong, but I haven’t heard anything about future plans for dropping current implementation of Browser.application.

1 Like

Ah, sorry, I didn’t read the other thread in enough detail to notice that alternate workaround.

I had seen that, but it wasn’t that easy for me. I’m using the elm-hot-webpack-loader so no clue how I can intercept/inject my own stuff. And below that somebody claims the posted code needed some work.

Perhaps I should fork me own compiler, or ask CurrySoftware to fix this in their fork.

Wow, I didn’t know about this elm fork. They look towards custom repos which probable means allowing JavaScript. This is exactly what elm is missing! If they do fix the body issue or add this repos functionality I will absolutely move to their compiler. So ask them! :grinning:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.