Skip to content

Prevent recaptcha input to enable keyboard input #92

@derek90

Description

@derek90

Is there any way to prevent the component to enable keyboard input? In my case, I'm using Ionic Framework 5, so when the user focus on the captcha (when another input had the foucs), it recognizes it as an input, so it fires the device soft keyboard and it's not necessary. I tried with the 'readonly' attribute as follows:

<ngx-recaptcha2 #captchaElem id="captchaElem"
          [siteKey]="'MySiteKey'"
          [hl]="translate.currentLang === 'la' ? 'es-419' : translate.currentLang === 'pt' ? 'pt-BR' : translate.currentLang"
          [theme]="darkModeService.isDark ? 'dark' : 'light'"
          formControlName="captcha"
          readonly="true">
</ngx-recaptcha2>

But it didn't work either. Everytime the user clicks on the recaptcha square when other input was focused, the application shows the soft keyboard because it recognizes it as input (which should not do that anymore with a readonly attribute set to true, as others input do)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions