JavaScript error creating text node of non-breaking space on Windows Mobile


(Stephen Chung) #1

Got an error in the logs:

TypeError: Argument not optional
   at _selectionChanged 
   at Anonymous function 
   at r 

Traced to this code:

application_version	4da4f986ee07571c0bab8d39ea0e283e3ac8f318
REQUEST_URI	/logs/report_js_error
REQUEST_METHOD	POST
HTTP_USER_AGENT	Mozilla/5.0 (Windows Phone 10.0; Android 6.0.1; Microsoft; RM-1113) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Mobile Safari/537.36 Edge/15.15063

What about document.createTextNode(" ") instead?


(Stephen Chung) #2

FireFox

createTextNode("\ufeff") ==> Node with one character
createTextNode(" ") ==> Node with  

Chrome

createTextNode("\ufeff") ==> Node with one character
createTextNode(" ") ==> Node with  

Edge

createTextNode("\ufeff") ==> EmptyTextNode
createTextNode(" ") ==> Node with  

So unfortunately we cannot use   as a replacement.

I believe this error has something to do with Edge?


(Stephen Chung) #3

May be related to this:


(Régis Hanol) #4

FYI: just tried on Microsoft Edge 40.15063.0.0 and could not reproduce this issue.


(Stephen Chung) #5

Well, I’ve no idea when it will trigger this. I just saw it in my logs

:sweat_smile:

If this will help: I suspect this is being viewed on Edge on Windows 10 Mobile on a Lumia 640. Probably not your typical mobile device…


(Joshua Rosenfeld) #6

We don’t support Windows 10 Mobile. See https://www.discourse.org/about#tablet-phone


(Jeff Atwood) #7

Microsoft does not even support Windows Mobile at this point.


(Stephen Chung) #8

Not an issue. Just pointing out an error that occurred. Doesn’t need fixing if it doesn’t happen on other devices.

Incidentally, Edge on Windows Mobile works just perfectly fine for Discourse (except for a few quirks on the soft keyboard covering up the last line of the reply window with buttons, the usual).

Maybe you can add a few “Not Officially Supported But Seems to Work Fine” devices?

:grin: