ionic-team / pwa-elements

Quality UI experiences for Web APIs that require custom UI (such as media/camera).
https://medium.com/@maxlynch/building-the-progressive-web-app-os-57daebcb69c1
MIT License
168 stars 50 forks source link

feat: Camera should allow for additional `accept` types for file selection #80

Open baffioso opened 3 years ago

baffioso commented 3 years ago

ionic/pwa-elements version:

@ionic/pwa-elements@3.0.2

I'm submitting a ... (check one with "x") [ ] bug report [x] feature request

Current behavior: At the moment accept="image/*" is hard coded as accepted input types, when users choose to select a local file/file from disk.

Expected behavior: Enable configuration of PWA camera for specifying accepted input types e.g. accept="image/png,image/jpeg"

Related code: https://github.com/ionic-team/pwa-elements/blob/6e1394a00b891a0242fea1f41b151681f1012d2a/src/components/camera/camera.tsx#L466-L471

Other information: https://forum.ionicframework.com/t/restrict-file-types-in-pwa-camera-from-ionic-pwa-elements-when-selecting-local-image/208222