Uppy: ImageEditor with @uppy/react inline Dashboard does not allow editing

Created on 27 Aug 2020  路  1Comment  路  Source: transloadit/uppy

Using the ImageEditor with an inline Dashboard shows the edit button, but when editing the edit functionality is just broken. And images are shown in their original size. Zoom is not working.

I am not sure if it's relevant but I am using nextjs on the frontend.

Kapture 2020-08-27 at 21 08 16

import React, { FunctionComponent, useState, useEffect } from 'react'
import Uppy from '@uppy/core'
import ImageEditor from '@uppy/image-editor'
import { Dashboard } from '@uppy/react'

const ImageUpload: FunctionComponent<Props> = (props, {}) => {
  const [uppy, setUppy] = useState(null)

  useEffect(() => {
    const uppyOptions = {
      autoProceed: false,
      restrictions: {
        maxFileSize: 5000000,
        maxNumberOfFiles: props.maxNumberOfFiles || 10,
        minNumberOfFiles: 1,
        allowedFileTypes: ['image/*'],
      },
    }

    const uppy = Uppy(uppyOptions)

    setUppy(uppy)

    uppy.use(ImageEditor, {
      id: 'ImageEditor',

      cropperOptions: {
        viewMode: 1,
        background: true,
        autoCropArea: 1,
        responsive: true,
      },
    })

    uppy.on('complete', () => {})
  }, [false])

  if (!uppy) return null

  return (
    <S.Dashboard__Container data-uppy-theme="dark">
      <Dashboard
        uppy={uppy}
        plugins={['ImageEditor']}
        metaFields={[{ id: 'name', name: 'Name', placeholder: 'File name' }]}
      />
    </S.Dashboard__Container>
  )
}

export default ImageUpload

    "react": "16.12.0",
    "react-dom": "^16.12.0",
    "next": "^9.4.4",
    "@uppy/core": "^1.13.1",
    "@uppy/dashboard": "^1.12.5",
    "@uppy/image-editor": "^0.1.5",
    "@uppy/react": "^1.10.5",
    "@uppy/xhr-upload": "^1.5.3",
Bug Triage

Most helpful comment

seems that all I was missing was the css import!

import '@uppy/image-editor/dist/style.css'

>All comments

seems that all I was missing was the css import!

import '@uppy/image-editor/dist/style.css'

Was this page helpful?
0 / 5 - 0 ratings