3 ms·
https://lord.io/text-editing-hates-you-too/ https://lord.io/text-editing-hates-you-too/ Generally speaking, implementing this stuff from scratch is a terrible
by chrismorgan 5y ago
https://lord.io/text-editing-hates-you-too/ https://lord.io/text-editing-hates-you-too/
Generally speaking, implementing this stuff from scratch is a terrible idea; especially on the web, it’s not possible to implement this stuff from scratch without losing platform functionality that is not exposed—though in the last couple of years the primitives have reached the point in functionality and consistency where you can get surprisingly close on most platforms. But things like touch grippies can’t be done, and I wouldn’t be surprised if various fancier touch keyboard interactions like swiping space bar to move the caret can’t be done (I haven’t tried, and I’m not sure how they’re implemented).
Things like CodeMirror are generally good, but it’s still not terribly uncommon for them to be completely broken on some less common but still up to spec and maintained platforms, because they’re simply being too clever for the web as a platform and I wish they’d relax and stop trying to be quite so clever.
- danielvaughn 5y agoIt makes me marvel at Google's engineering since they re-built Docs from scratch using canvas.
- asiachick 5y agoYes, and Flutter, the web version, also does it from scratch. Which means CJK sucks on Flutter
- samwillis 5y agoExactly, the new Google Docs is a great example of how it can can be done, but only by a company with the resources they have. I have wandered if the solution is to use WASM to take a desktop rich text editor and make it available in the browser within a Canvas element.
- asiachick 5y agoNo, new Google Docs sucks For one, extensions that help with translation no longer function because there is no text for them to read. For two, any language that uses an IME (Chinese, Japanese, Korean, Thai, etcc...) the experience is super subpar
- danielvaughn 5y agoYeah I'm really interested in seeing something like that, for general purpose. I'd love to see what's possible with WASM + WebGPU for stuff like this.