1.21 gigawatts
1.21 gigawatts

Reputation: 17762

How to disable keyboard navigation on a Spark List?

The keyboard interaction on my list is causing it to jump between different list items. The list should only respond to mouse events so I'd like to turn off keyboard handling.

I found this method which overrides the List class but I'd like to know if there's another method.

Upvotes: 0

Views: 62

Answers (1)

1.21 gigawatts
1.21 gigawatts

Reputation: 17762

Here's the extended class override:

import flash.events.KeyboardEvent;

import spark.components.List;

public class ListNoKeyboardHandling extends List
{
    public function ListNoKeyboardHandling()
    {
        super();
    }

    override protected function keyDownHandler(event:KeyboardEvent):void {
        // do nothing
    }
}

Upvotes: 2

Related Questions