Image 'alt' attribute is there by default.

This commit is contained in:
Ivo Valchev
2020-02-24 13:38:42 +01:00
parent 85cfbe0fdf
commit 64dfb13519
2 changed files with 7 additions and 2 deletions

View File

@@ -232,7 +232,8 @@ export default {
this.previewImage = null;
this.filenameData = '';
this.thumbnailData = '';
this.altData = '';
// only reset altData if alt should be displayed.
if (this.altData !== undefined) this.altData = '';
this.$emit('remove', this);
},
selectUploadFile() {

View File

@@ -103,6 +103,10 @@ class ImageField extends Field implements FieldInterface, MediaAwareInterface
public function includeAlt(): bool
{
return $this->getDefinition()->has('alt') && $this->getDefinition()->get('alt') === true;
if (! $this->getDefinition()->has('alt')) {
return true;
}
return $this->getDefinition()->get('alt') === true;
}
}