Skip to content

Instantly share code, notes, and snippets.

@mzaini30
Created June 30, 2021 09:01
Show Gist options
  • Save mzaini30/70d104e6e315bc2762f1f2e00105d423 to your computer and use it in GitHub Desktop.
Save mzaini30/70d104e6e315bc2762f1f2e00105d423 to your computer and use it in GitHub Desktop.
import {Portal} from 'solid-js/web'
import {createSignal} from 'solid-js'
const [data, setData] = createSignal({tulisan: '<p>hello <strong>world</strong></p>'})
const Tulis = () => (
<div>
<div className="grid grid-cols-4">
<div className="">
<p>Hai</p>
</div>
<div className="col-span-3">
<div className="rounded grid gap-2 grid-cols-2 bg-green-100 p-3 shadow bordered" style='height: calc(100vh - 70px)'>
<div className="focus:outline-none p-2 bg-green-200 overflow-auto rounded" contenteditable onInput={x => setData({tulisan: x.target.innerHTML})} innerHTML={data().tulisan}></div>
<textarea name="" value={data().tulisan} onInput={x => setData({tulisan: x.target.value})} id="" cols="30" rows="10" className="bg-green-200 p-2 focus:outline-none rounded"></textarea>
</div>
</div>
</div>
<Portal mount={document.head}>
<title>Tulis</title>
</Portal>
</div>
)
export default Tulis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment