prestaconcept / PrestaImageBundle

Allow to crop local and remote image before uploading them through a classic form.
MIT License
23 stars 19 forks source link

Delete Button #57

Closed aurelienblanc closed 4 years ago

aurelienblanc commented 4 years ago

Hi, I successfully implement your Bundle and it works well. Except that as i understand you code a delete button should appear after I've load a picture from my computer and crop it in the modal. The delete button don't appear. Did I miss something ?

$builder
        ->add('imageFile', ImageType::class,[
            'label'=>false,
            'enable_remote'=> false,
            'aspect_ratios'=> [],
            'delete_label'=>'Supprimer l\'image',
            'upload_button_class'=>'btn btn-primary',
            'upload_button_icon'=>'fas fa-upload',
            'cancel_button_class'=>'btn btn-secondary',
            'cropper_options'=> [
                'viewMode'=> 3,
                'aspectRatio'=>1,
            ],
        ]);
yann-eugone commented 4 years ago

Hello !

Maybe your issue is related to the fact that, as your field is required the delete button should not be rendered.

This has been done in https://github.com/prestaconcept/PrestaImageBundle/pull/46

Please try to add the 'required' => false option, and see if the button shows up.