Bug 258658 - File programatically added to <input type="file"> not shown
Summary: File programatically added to <input type="file"> not shown
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari Technology Preview
Hardware: Mac (Apple Silicon) macOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-06-29 00:27 PDT by jonathan
Modified: 2023-07-06 00:28 PDT (History)
6 users (show)

See Also:


Attachments
Screenshot of problem in Safari (155.86 KB, image/png)
2023-06-29 00:27 PDT, jonathan
no flags Details
Screenshot of better behaviour on iPadOS (145.57 KB, image/png)
2023-06-29 00:27 PDT, jonathan
no flags Details
Screenshot of better behaviour in Chrome (148.67 KB, image/png)
2023-06-29 00:27 PDT, jonathan
no flags Details
Screenshot of better behaviour in Firefox (148.95 KB, image/png)
2023-06-29 00:27 PDT, jonathan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description jonathan 2023-06-29 00:27:05 PDT
Created attachment 466858 [details]
Screenshot of problem in Safari

## Overview:

When programmatically adding a file to an <input type="file"> element, the file input does not show any indication in the UI that a file is present.

## Steps to Reproduce:

Run the code snippet in this post: https://stackoverflow.com/a/68182158

## Actual Results:

The file input is shown in its default state, as if there are no files selected. It only shows the "Choose File" button, and there is no text/filename next to it.

## Expected Results:

It would be more useful if the file input showed the name of the file that was added programatically (like Chrome and Firefox do). That indicates to the user that a file is present in the input.

## Build Date & Hardware:

- Safari: Version 16.5.1 (18615.2.9.11.7)
- Safari Technology Preview: Release 173 (Safari 17.0, WebKit 18616.1.20.2)

## Additional Builds and Platforms:

The problem does not occur on iPadOS 16.4 (Simulator) and iOS 16.5.1 (device).
Comment 1 jonathan 2023-06-29 00:27:28 PDT
Created attachment 466859 [details]
Screenshot of better behaviour on iPadOS
Comment 2 jonathan 2023-06-29 00:27:40 PDT
Created attachment 466860 [details]
Screenshot of better behaviour in Chrome
Comment 3 jonathan 2023-06-29 00:27:50 PDT
Created attachment 466861 [details]
Screenshot of better behaviour in Firefox
Comment 4 Radar WebKit Bug Importer 2023-07-06 00:28:17 PDT
<rdar://problem/111833099>