Managed file element using "button" option appears to incorrectly invalidate valid uploads

Created on 30 October 2024, 11 months ago

Problem/Motivation

On a webform:

- with a managed file element
- and the file upload element uses the "Replace file upload input with an upload button" feature
- and allows multiple file uploads
- and limits valid file types

Attempting to upload an invalid file after uploading a valid file incorrectly adds the class "error" to the checkbox for the valid file.

The class is added, but the form still validates.

When I focus on the checkbox, a screen reader (VoiceOver) announces, "invalid data unchecked".

I tested this in the Olivero theme on a standard Drupal 10.3 installation.

Steps to reproduce

1. Create a webform as described above. I am attaching the config for an example webform.

The example form allows the .png file extension but no others.

2. Upload a valid file with the .png extension.

3. Attempt to upload a file with a different extension.

Alternatively, attempt to upload the file with the valid extension and one with an invalid extension at the same time.

4. Notice the checkbox for the valid uploaded file has a red border and the class 'error'.

This behavior only occurs when the "Replace file upload input with an upload button" checkbox is checked.

πŸ› Bug report
Status

Active

Version

6.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States calebtr

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024