Hacker News new | ask | show | jobs
by hamza512b 24 days ago
What choice do we have? We have to find a solution to the problem. ContentEditable is much harder to work with. This is a solution, and I hope we will at some point work out a new web API that makes these tasks easier.

Your reasoning is that I am missing out on a large percentage of users. I understand where this is coming from. I am working on mobile apps as well, as I did with iOS. I can try to close that gap even more, but I can't just switch to ContentEditable. I don't have the time, and there are already tons of projects that do that.

But if Google did it at their scale, then I think the tradeoff is reasonable, don't you think? You said in another HN post that they don't really use pure canvas. What do you mean? ContentEditable for capturing input?

1 comments

By the time you’ve fixed as much as you can, you will certainly have more code, more complex code and more fragile code than you would have had from massaging contenteditable into your desired shape, and your result won’t even be better than it in any indisputable way.

“Pure canvas” means when the entire app runs inside a canvas to the maximum extent possible, such as with https://www.egui.rs/. Google Docs isn’t pure canvas because it uses regular DOM for the chrome, leaves text rendering to the browser (fillText or whatever) and uses real scrolling area (multiple canvases, tiling). Yours is similarly not pure canvas, though it’s a little closer in the obviously-bad way of how you implement scrolling yourself.

“Google did it” is not an endorsement for others doing it. They have often quite bizarre rationales that truly don’t apply to smaller organisations. As I have written, I’ve thought it through carefully multiple times in multiple ways, and I honestly believe they were lying about their motives through and through, because they just don’t make any sense. Google Docs was unambiguously better before they migrated to canvas, and most of their claims about what it got them were demonstrably false.

So browsers are evil when they prefer to be backwards bug compatible rather than fix their contenteditable. That puts the onus on billions of users who can't do shit about it, and that's supposed to be okay. What a shoddy state of affairs!

That's what makes me applaud the effort here, and any defects it may have are less important than fixing the basic deterministic key-stroke driven editing behavior (which is what they fail at).

It's not necessary to fix everything to the needs of everybody, and be perfect. It's rather easy to be better in that one critical aspect, and put contenteditable to shame in 80% of the use cases.

I think you defeated yourself when you took on the responsibility for a 100% coverage replacement. Didn't you notice that this wasn't your responsibility to begin with? There is a market for a neat, capable, and deterministic markdown based editor.

You’re talking nonsense, saying things I’ve already rebutted. The replacement is utterly unsuitable for the various reasons already described, and fundamentally cannot ever be made suitable (a lot of what remains will certainly never be exposed by browsers). We’re not talking about exotic functionality missing, we’re talking fairly basic things on desktop and very basic things on mobile. As for “put contenteditable to shame”… I have not seen a single thing that is indisputably better.