Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
onKeyPress eventlistener no funciona después de centrarse en iframe (Reactjs)

Tengo un problema que no sé cómo tratar. Estoy usando el componente HCaptcha para la verificación y después de que el usuario hace clic en la casilla de verificación para verificar, mi eventListener 'keydown' ya no funciona. Aparentemente, el problema es que HCaptcha se está procesando en iframe y la página pierde el foco después de verificarlo. ¿Alguien tiene alguna idea? Gracias por tu ayuda.

 useEffect(() => { const listener = event => { if (event.code === 'Enter' || event.code === 'NumpadEnter') { event.preventDefault(); btnRef.current?.click(); } }; document.addEventListener('keydown', listener); return () => { document.removeEventListener('keydown', listener); }; }, []); return ( <div className="auth-footer"> <HCaptcha sitekey={window._env_.hCaptchaSiteKey} onVerify={token => { setCapchaToken(token); formRef.current?.focus(); }} ref={captchaRef} /> <div className="tw-my-6"> <Button ref={btnRef} type="button" disabled={formValidation()} onClick={handleSubmit} loading={loading} className="btn reset-password-submit"> ارسال کد </Button> </div> </div> )
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!