React Calculator not working on Safari

Hi there. Could someone help me with my React Calculator? It isn’t working on Safari.

I’ve finished and submitted the project, passing all the tests. It works perfectly on Chrome, looks great on Safari and even works sometimes on Safari.

When I click a button, my click handler will sometimes return the string with the final quotation mark on the next line. This is effecting the function.

My codepen is

EDIT: OK, so after some exploring, I found that Safari was adding space around the value on clicks. So I added trim() to the value before running it through my abstract factory.

Many thanks

That is odd, just out of curiosity does it also contain spaces when using textContent instead of innerText?

Hi, thanks. I just tested this, and textContent eliminates the problem too.


Interesting, thank you for testing it.