Skip to content

FileUpload field can’t be emptied once a file has been set #321

Description

@Daaaaad

Affected component

modules/prettyblocks/_dev/src/components/form/FileUpload.vue

Current behavior

  1. Add a block that contains a fileupload field.
  2. Upload an image and save the block – the image is correctly stored.
  3. Re-open the block, click the trash icon to remove the image.
  4. Save the block again.

The previously deleted image (or a placeholder) is saved back automatically – the field is never persisted as empty.

Expected behavior

After deleting the file and saving, the field should remain empty (no image stored and no placeholder URL persisted).
Impact

It is currently impossible to make a fileupload field optional. Once a file has been uploaded, the user cannot revert to “no file”.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions