Angus
Angus

Reputation: 361

AngularJS analogue to jQuery preventDefault for keydown?

I need the browser to respond to keydown arrow events in focused scrollable boxes. Here is a Plunker to show what I mean

http://plnkr.co/edit/Okch5dEByFkueJl0DmwG

Even if I tell the event to stop propagating with event.stopPropagation() and make the event handler return false the box keeps scrolling on keydown.

Upvotes: 3

Views: 3400

Answers (1)

Ryan O'Neill
Ryan O'Neill

Reputation: 3757

Unless I'm mistaken as far as what you're looking for, you should just be able to change your

event.stopPropagation()

back to

event.preventDefault()

and it will work as desired.

Upvotes: 7

Related Questions