Skip to content

Commit

Permalink
Use textarea text for initial doc
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmyersdev committed Jul 6, 2023
1 parent 5aff5b9 commit b509b97
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ export const solidPrepareForHydration = () => {

export const wrap = (textarea: HTMLTextAreaElement, options: Ink.Options = {}) => {
const replacement = <div class='ink-mde-textarea' /> as HTMLDivElement
const doc = textarea.value

textarea.after(replacement)
textarea.style.display = 'none'

const instance = render(replacement, options)
const instance = render(replacement, { doc, ...options })

if (textarea.form) {
textarea.form.addEventListener('submit', () => {
Expand Down

0 comments on commit b509b97

Please sign in to comment.