I am using drupal 8.4.2. I have created my content type and I have an image field in the form fields.
The image upload field is showing on the page but, the upload button is not showing. If I inspect the element, I can see that 'js-hide'
class is added for the upload button. I think that is coming from the processManagedFile
function in core/modules/file/src/Element/ManagedFile.php
file
$element['upload_button'] = [
'#name' => $parents_prefix . '_upload_button',
'#type' => 'submit',
'#value' => t('Upload'),
'#attributes' => ['class' => ['js-hide']], //hide class added from here
'#validate' => [],
'#submit' => ['file_managed_file_submit'],
'#limit_validation_errors' => [$element['#parents']],
'#ajax' => $ajax_settings,
'#weight' => -5,
];
It means upload button is hidden in Drupal 8 by default.?
If so, after selecting an image, the upload should happen automatically. That is also not happening?
What might be the problem? Is there any setting I need to enable? I would like to have either upload button or the image should be uploaded automatically after selecting an image.
Note: I am having this form for admin. So any changes have to be done in theme, I should do that in seven theme.