onfido-sdk-ui icon indicating copy to clipboard operation
onfido-sdk-ui copied to clipboard

On mobile devices, the class `onfido-sdk-ui-Theme-step` has a `height: 0`

Open ravinpatel opened this issue 3 years ago • 2 comments

What was the expected behaviour?

Display the full modal of the SDK

What happened instead?

the class has a 0 height so it appears as a line

Screenshot 2021-09-02 at 15 47 31 Screenshot 2021-09-02 at 15 47 35

When I remove this style, it appears as:

Screenshot 2021-09-02 at 15 48 23 Screenshot 2021-09-02 at 15 48 27

Version info:

  • Onfido SDK: 6.13.0
  • OS: Android
  • Browser: Chrome (same experience on all mobile browsers)
  • Device: Samsung S21 (same experience on multiple devices)

Integration configuration:

Please add code snippet(s) of your integration with the Onfido SDK and all customisations of it.

Steps to reproduce:

export const DocumentFaceStep: React.FC<DocumentFaceStepProps> = ({ setShowPOA }) => {
  const userID = useSelector((state) => state.user.id)

  const [t] = useTranslation()
  const dispatch = useDispatch()

  useEffect(() => {
    setupOnfido()
    dispatch(hideLoader())
  }, [])

  const setupOnfido = async () => {
    await createOnfidoJWT(userID)
      .then((res) => {
        if (typeof window !== 'undefined') {
          import('onfido-sdk-ui').then(({ init }) => {
            init({
              token: res.onfido_token,
              containerId: 'onfido-mount-doc-face',
              onComplete: async () => {
                setShowPOA(true)
              },
              onError: (err) => {
                // eslint-disable-next-line no-console
                console.log('Onfido Err', err)
                window.Sentry.captureException(err)
              },
              steps: [
                {
                  type: 'welcome',
                  options: {
                    title: 'Before you get started',
                    descriptions: [
                      'Have your passport and proof of address (e.g., utility bill or bank statement) or scans/photos thereof ready',
                      'Your proof of address MUST be dated within the last 3 months',
                    ],
                    nextButton: 'Start ID Check',
                  },
                },
                {
                  type: 'document',
                  options: {
                    documentTypes: {
                      passport: true,
                      driving_licence: false,
                      national_identity_card: false,
                    },
                  },
                },
                'face',
              ],
              language: {
                phrases: {
                  capture: {
                    switch_device: 'Take photo using phone',
                    upload_file: 'Upload a scan or photo',
                    passport: {
                      front: {
                        title: 'Passport verification',
                      },
                    },
                    bank_building_society_statement: {
                      front: {
                        instructions: 'You must clearly show the entire page',
                        sub_title:
                          '<strong>IMPORTANT</strong>: This must be dated within the last 3 months. You must clearly show the entire page',
                      },
                    },
                    utility_bill: {
                      front: {
                        instructions: 'You must clearly show the entire page',
                        sub_title:
                          '<strong>IMPORTANT</strong>: This must be dated within the last 3 months. You must clearly show the entire page',
                      },
                    },
                    government_letter: {
                      front: {
                        instructions: 'You must clearly show the entire page',
                        sub_title:
                          '<strong>IMPORTANT</strong>: This must be dated within the last 3 months. You must clearly show the entire page',
                      },
                    },
                  },
                  image_quality_guide: {
                    title: 'Passport verification',
                  },
                  cross_device: {
                    switch_device: {
                      header:
                        'Upload a scan or photo of your document, or take a picture of it using your smartphone. You must clearly show the entire page',
                    },
                    submit: {
                      title: 'Thank you, that’s everything we need',
                      one_doc_uploaded: 'Documents uploaded',
                      action: 'Submit ID Check',
                    },
                  },
                  confirm: {
                    document: {
                      title: 'Make sure the whole page is clearly visible and readable',
                    },
                    passport: {
                      message: 'You must clearly show the entire page',
                    },
                  },
                  document_selector: {
                    proof_of_address: {
                      hint: 'Remember: your document MUST be dated within the last 3 months',
                    },
                  },
                  cross_device_checklist: {
                    title: 'One more thing to do',
                    subtitle: 'Here’s everything you’ve uploaded so far:',
                    list_item_doc_one: 'Identity document',
                    button_primary: 'Proceed to address verification',
                  },
                },
                mobilePhrases: {
                  capture: {
                    passport: {
                      front: {
                        instructions:
                          'Upload a scan/photo of your passport, or take a picture of it using your smartphone. You MUST clearly show the entire page of your passport',
                      },
                    },
                  },
                },
              },
            })
          })
        }
      })
      .catch(() => {
        dispatch(setFormErrors(t('onBoarding.idCheck.error.unavailable')))
      })
      .finally(() => {
        dispatch(hideLoader())
      })
  }

  return (
    <div>
      <div id="onfido-mount-doc-face" />
    </div>
  )
}

ravinpatel avatar Sep 02 '21 14:09 ravinpatel

in fact I think it is an issue with this style:

@media screen and (max-width: 479px) {
  .onfido-sdk-ui-Modal-inner

Trying to override on our side

ravinpatel avatar Sep 02 '21 15:09 ravinpatel

Hi @ravinpatel

We have that block of styling for that media query break point to have the SDK display on the entire viewport on mobile devices but it can sometimes clash with host apps/sites that have their own mobile layouts which seems to be the case from the screenshot above.

I would recommend overriding on your stylesheet, I believe removing or setting the height to auto should help.

kopijunkie avatar Sep 08 '21 15:09 kopijunkie