Post

Replies

Boosts

Views

Created

iOS Safari: Taking multiple photos via camera in overrides previous capture instead of accumulating
Summary On iOS Safari (and WKWebView-based browsers), when a web page uses <input type="file" accept="image/*" capture="environment"> (or capture="user"), the user can only ever hold one captured photo at a time. Each time the file picker is opened and the user takes a new photo using the camera, the newly captured image completely replaces the previously captured image in the input's files FileList. There is no way to accumulate multiple camera-captured photos across successive picker sessions. Steps to Reproduce Set up a web page with an <input type="file" accept="image/*" multiple> element (with or without the capture attribute). Open the page in iOS Safari on an iPhone. Tap the file input — choose Take Photo from the action sheet. Capture a photo and tap Use Photo. Verify input.files.length === 1 (first photo is captured). Tap the same file input again — choose Take Photo again. Capture a second photo and tap Use Photo. Check input.files.length. Expected Result input.files.length should be 2 (or more), containing both the first and second captured photos. The browser should accumulate photos across picker sessions when the multiple attribute is present. Actual Result input.files.length is 1 — only the most recently captured photo is present. The previously captured photo is completely gone. Every new camera capture wipes out all prior selections. Root Cause Analysis On iOS, each invocation of the system file picker (whether using the camera or photo library) creates a brand-new FileList and assigns it to the input element, discarding any previously selected files. The FileList interface is read-only per the HTML spec — web developers cannot programmatically append File objects to it. The DataTransfer API workaround (constructing a new FileList via DataTransfer.items.add()) does not work on iOS Safari — the DataTransfer constructor is not supported for programmatic file list manipulation in file inputs on iOS WebKit. This is specific to iOS. On macOS Safari and all desktop browsers, users can select multiple files in a single picker session, avoiding this issue. Impact This makes it impossible to build a web-based multi-photo capture workflow on iOS using standard HTML APIs. Common real-world use cases that are broken: Uploading multiple photos of a document one page at a time Capturing multiple product photos for a listing Progressive photo capture in inspection or form-filling apps Any PWA or web app requiring sequential camera captures Users must select all photos in a single picker session. If they tap "Cancel" or close the picker, all prior captures are permanently lost. Request Please fix WebKit on iOS so that when <input type="file" multiple> is used, re-opening the file picker either: Accumulates newly selected/captured files into the existing FileList, or Presents the system picker with previously selected files pre-checked (similar to how macOS handles re-opening file dialogs), or Exposes a web API (e.g., via the File System Access API's showOpenFilePicker() with multi-select) that developers can use to manage a cumulative file collection on iOS. Environment Devices: iPhone 13, 14, 15 Pro (physical devices) iOS versions: iOS 16.x, 17.x, 18.x — all affected Browser: Safari (Mobile) Also reproduced in: Chrome for iOS, Firefox for iOS (both use WKWebView) Not reproducible on: macOS Safari, Chrome desktop, Firefox desktop A Feedback Assistant report has been filed. Happy to provide a minimal HTML repro page on request.
Topic: Safari & Web SubTopic: General
1
0
137
22h
iOS Safari: Taking multiple photos via camera in overrides previous capture instead of accumulating
Summary On iOS Safari (and WKWebView-based browsers), when a web page uses <input type="file" accept="image/*" capture="environment"> (or capture="user"), the user can only ever hold one captured photo at a time. Each time the file picker is opened and the user takes a new photo using the camera, the newly captured image completely replaces the previously captured image in the input's files FileList. There is no way to accumulate multiple camera-captured photos across successive picker sessions. Steps to Reproduce Set up a web page with an <input type="file" accept="image/*" multiple> element (with or without the capture attribute). Open the page in iOS Safari on an iPhone. Tap the file input — choose Take Photo from the action sheet. Capture a photo and tap Use Photo. Verify input.files.length === 1 (first photo is captured). Tap the same file input again — choose Take Photo again. Capture a second photo and tap Use Photo. Check input.files.length. Expected Result input.files.length should be 2 (or more), containing both the first and second captured photos. The browser should accumulate photos across picker sessions when the multiple attribute is present. Actual Result input.files.length is 1 — only the most recently captured photo is present. The previously captured photo is completely gone. Every new camera capture wipes out all prior selections. Root Cause Analysis On iOS, each invocation of the system file picker (whether using the camera or photo library) creates a brand-new FileList and assigns it to the input element, discarding any previously selected files. The FileList interface is read-only per the HTML spec — web developers cannot programmatically append File objects to it. The DataTransfer API workaround (constructing a new FileList via DataTransfer.items.add()) does not work on iOS Safari — the DataTransfer constructor is not supported for programmatic file list manipulation in file inputs on iOS WebKit. This is specific to iOS. On macOS Safari and all desktop browsers, users can select multiple files in a single picker session, avoiding this issue. Impact This makes it impossible to build a web-based multi-photo capture workflow on iOS using standard HTML APIs. Common real-world use cases that are broken: Uploading multiple photos of a document one page at a time Capturing multiple product photos for a listing Progressive photo capture in inspection or form-filling apps Any PWA or web app requiring sequential camera captures Users must select all photos in a single picker session. If they tap "Cancel" or close the picker, all prior captures are permanently lost. Request Please fix WebKit on iOS so that when <input type="file" multiple> is used, re-opening the file picker either: Accumulates newly selected/captured files into the existing FileList, or Presents the system picker with previously selected files pre-checked (similar to how macOS handles re-opening file dialogs), or Exposes a web API (e.g., via the File System Access API's showOpenFilePicker() with multi-select) that developers can use to manage a cumulative file collection on iOS. Environment Devices: iPhone 13, 14, 15 Pro (physical devices) iOS versions: iOS 16.x, 17.x, 18.x — all affected Browser: Safari (Mobile) Also reproduced in: Chrome for iOS, Firefox for iOS (both use WKWebView) Not reproducible on: macOS Safari, Chrome desktop, Firefox desktop A Feedback Assistant report has been filed. Happy to provide a minimal HTML repro page on request.
Topic: Safari & Web SubTopic: General
Replies
1
Boosts
0
Views
137
Activity
22h