Web Development

Can I just Get a Single Break???

by Cory on November 15, 2019 12:22 AM (Edited November 29, 2019 12:42 PM)

Man. I just made a commit to the forum code where I hacked in support for Android mobile. I spend like two weeks doing this and that trying to get fucking SlateJS and React to work nicely on Android and nothing worked.

I ended up just giving up completely on that and using contentEditable and then just serializing that into a SlateJS JSON value when the form is submitted. Fucking stupid.

So now you can post (plain text only) to the forum. But guess what? No that's too good to be true, because somehow now backspace is broken on desktop so SlateJS fucks up completely if you make a mistake, press backspace, and continue typing. Not gonna lie, I'm super frustrated by SlateJS right now. The online demo seems to work perfectly but it's a pain in the ass to understand and for some reason it keeps breaking for me...

EDIT: Fixed.

Good old git bisect. I found the right commit and then it turns out I added onKeyDown = () => {}. And then I add this as a react prop to the slate editor and somehow this fucks up backspace. Amazing.

I added a new selenium test to make sure the backspace isn't fucked up again.

If development on this is going to continue, I think I really need to change it so that the backend is only RESTful and then the front end contains the entire MVC and routing and shit. That way the entire forum application's presentation layer is contained nicely in the frontend javascript.

This Thought is part of Web Development

General Web Development Thoughts and Odds and Ends

back to the