Skip to content

Commit

Permalink
worked on image dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
LiveDuo committed Nov 6, 2023
1 parent 7cb34c6 commit 2e85d35
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/client/vanilla/image.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useRef, ChangeEvent } from 'react'
import React, { useState, useRef, ChangeEvent, useEffect } from 'react'

import * as DialogPrimitive from '@radix-ui/react-dialog'

Expand All @@ -19,6 +19,10 @@ const Dialog: React.FC<DialogProps> = ({ open, setOpen, selectedElement, standal
const [urlText, setUrlText] = useState<string>('')
const input = useRef<HTMLInputElement>(null)

useEffect(() => {
setUrl(selectedElement?.getAttribute('src') ?? '')
}, [open])

const onUpload = async (e: React.ChangeEvent<HTMLInputElement>) => {
e.preventDefault()

Expand Down

0 comments on commit 2e85d35

Please sign in to comment.