Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal is not closed when cancel/verify captcha and shows error on Android #28

Closed
mhNirob opened this issue Nov 1, 2022 · 6 comments
Closed
Assignees

Comments

@mhNirob
Copy link

mhNirob commented Nov 1, 2022

When I click outside captcha modal or finish verifying the captcha images disappear but the transparent black background doesn't. And I get Maximum call stack size exceeded error.

Seems like captchaRef?.hide() is not working on android, and it is causing this issue.

Code -

  let captchaRef = useRef(null);

  const onMessage = (event) => {
    if (event && event.nativeEvent.data) {
      if (['cancel', 'error', 'expired'].includes(event.nativeEvent.data)) {
        handleCaptchaSubmit(null);
      } else {
        handleCaptchaSubmit(event.nativeEvent.data);
        setTimeout(() => {
          handleCaptchaSubmit(null);
          setIsChecked((prevIsChecked) => !prevIsChecked);
        }, 12000);
      }
      captchaRef?.hide();
    }
  };

  <ConfirmHcaptcha
    mode
    siteKey={Secrets.CAPTCHA_SITEKEY}
    baseUrl={captchaBaseUrl}
    languageCode="en"
    ref={(_ref) => (captchaRef = _ref)}
    onMessage={onMessage}
  />

Tested on: Android Emulator - Pixel 3A

Screenshot_1667306407

Screen.Recording.2022-11-01.at.6.55.00.PM.mov
@e271828-
Copy link
Contributor

e271828- commented Nov 1, 2022

@mhNirob which Android version is this?

@mhNirob
Copy link
Author

mhNirob commented Nov 1, 2022

@e271828- Android version is 13.0

@CAMOBAP
Copy link
Collaborator

CAMOBAP commented Nov 1, 2022

@mhNirob could you please also share information about your app:

  1. react-native version?
  2. Are you using expo?

@mhNirob
Copy link
Author

mhNirob commented Nov 2, 2022

@CAMOBAP

  1. react native version is - 0.68.2
  2. No, I am not using expo

@beqramo
Copy link

beqramo commented Nov 3, 2022

Same issue here too, any help?

CAMOBAP added a commit that referenced this issue Nov 7, 2022
CAMOBAP added a commit that referenced this issue Nov 7, 2022
e271828- added a commit that referenced this issue Nov 9, 2022
* #28 fix dialog hiding on backdrop

* Update dependencies list in MAINTAINER.md

* Update snap for tests

* Upload apks as artifact

* Update MAINTAINER.md

Co-authored-by: e271828- <e271828-@users.noreply.github.com>

* Fix GitHub Actions deprecated set-output

Co-authored-by: e271828- <e271828-@users.noreply.github.com>
@e271828-
Copy link
Contributor

e271828- commented Nov 9, 2022

Closed in 1.4.2

@e271828- e271828- closed this as completed Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants