Add support for iPhone 6 iOS 12.5
- Using the legacy build of PdfJS allows for the Select File button to open the file dialog on iPhone 6 12.5.4. It also fixes the Ontario Ministry of Health button and an error that appears due to PdfJS import when opening the app in dev mode. - Fix selected files not being used when selected on iOS devices. Safari on these devices currently does not support "input" event on selected file change. "change" event should be used to support these devices. https://stackoverflow.com/a/58342757 https://caniuse.com/input-event
This commit is contained in:
parent
884ba7bbec
commit
1b2d5309b8
|
@ -106,7 +106,7 @@ function Form(): JSX.Element {
|
||||||
// Add event listener to listen for file change events
|
// Add event listener to listen for file change events
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (inputFile && inputFile.current) {
|
if (inputFile && inputFile.current) {
|
||||||
inputFile.current.addEventListener('input', () => {
|
inputFile.current.addEventListener('change', () => {
|
||||||
let selectedFile = inputFile.current.files[0];
|
let selectedFile = inputFile.current.files[0];
|
||||||
if (selectedFile !== undefined) {
|
if (selectedFile !== undefined) {
|
||||||
setQrCode(undefined);
|
setQrCode(undefined);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {PayloadBody, Receipt} from "./payload";
|
import {PayloadBody, Receipt} from "./payload";
|
||||||
import * as PdfJS from 'pdfjs-dist'
|
import * as PdfJS from 'pdfjs-dist/legacy/build/pdf'
|
||||||
import {COLORS} from "./colors";
|
import {COLORS} from "./colors";
|
||||||
import { getCertificatesInfoFromPDF } from "@ninja-labs/verify-pdf"; // ES6
|
import { getCertificatesInfoFromPDF } from "@ninja-labs/verify-pdf"; // ES6
|
||||||
import * as Sentry from '@sentry/react';
|
import * as Sentry from '@sentry/react';
|
||||||
|
|
Loading…
Reference in New Issue