1

keypress is not get triggered on an overlay, after clicking on the overlay it works. Is there a way to trigger keypress without clicking on the overlay.

2
  • post your code please Commented Jan 18, 2018 at 11:04
  • your question is the answer to your question. Commented Jan 18, 2018 at 22:06

1 Answer 1

0

You need to have focus on the overlay or set the keylistneer closer to the body element.

Just set focus using yourElwment.focus() and it should work.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.