Widgets with choo
See original GitHub issueI’m trying to create a reusable element that implements Quill but I can’t figure out how to do it. The issue I’m having is that on re-render the Quill editor gets wiped; I don’t know how to maintain the state of it.
The most basic example:
const html = require('choo/html')
const onload = require('on-load')
const Quill = require('quill')
module.exports = richtext
function richtext (state, prev, send) {
const div = html`<div></div>`
onload(div, (el) => {
const quill = new Quill(el)
quill.on('text-change', () => {
send() // triggers re-render and DOM state is lost
})
})
return div
}
I used virtual-widget a while back - something like that would be ideal for this.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
dog Memo Widget for iPhone & Android by Choo Choo7264 ...
With Widget club, you can customize from various kinds of stunning widgets and icon pack and create your own easily! and also, you...
Read more >How to Create and Add Widgets on an iPhone - Howchoo
How to Create and Add Widgets on an iPhone · Widget Creation Steps: · Press and Hold · Click the Plus Sign ·...
Read more >How to Use the Pokemon Go Egg Hatching Widget
This widget, actually called Adventure Sync: Egg, is a widget that tracks your egg-hatching progress when Pokemon GO is in the background.
Read more >The Art of Flutter: Widget Explained | by Jason Choo - Medium
Flutter provides a comprehensive range of pre-built widgets that cover most of the use cases to develop your desired user interfaces with ...
Read more >Routing - Choo
This chapter is intended to give an overview of how routing works in Choo. ... need routing at all, for example when using...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yay, all the PRs have been merged and it should all be working. As per #1 we’re now building out cache-element/widget which should allow for super clean widgetization of elements ✨ The API looks like this:
I think this should answer your question; consider watching / contributing to
cache-element
to get this out faster, but in essence all the lower level components now work and exist 😁waiting on https://github.com/patrick-steele-idem/morphdom/issues/77 to be published; made a demo on how to create widgets with the
isSameNode()
API here: https://github.com/shama/on-load/issues/10#issuecomment-246118634 (e.g. thunking!)This should provide exactly the experience we intended to have from the start 🎉