javascript - How do I capture keyPress events on an item in a list with ember.js? -


I'm trying to improve access to the app that is writing. I am learning more about Amber As a practice, I am working with () to add features that help the users of the screen readers.

One thing I would like to learn how to do is edit the trigger of a tood item from the keyboard. The title of the item holds and the label will open the item for editing. This behavior is controlled by a action assistant, which I think specifically to make the elements clickable Here is the part of the template in question. I removed the code's features to remove unrelated logic:

  {{# item = controller = "todo"}}   

"Do not use the action assistant" seems to be starting to get started. But now what is the best way to handle each item? each is an TodoController in the itemController = "todo" (which is the object controller ) That defines a editTodo function that triggers a main press event that is a function. (For now, we can only ignore the investigation of the incident to capture the Entre / Retron key.)

I added tabindex = "0" to the label element Taken, and it appears that I can focus it with my keyboard. I have tried to add the key function to the Todo controller in the verb hash, but when I press the key it is not triggered. I think this is because in fact there is no view for each item - ArrayController for Todo and handling the display of Todo items between templates

I have read a lot today, and it looks like Each item may need to specify view , possibly to specify a container view and its itemViewClass property, so that I After inserting it, focus on the scene. But Amber does not use each assistant in its examples on the site: they have low-level mechanisms to add a rendered view, which I suspect is not the current best practice < P> I suspect there are more than one way to do this, but I'm still very new to understand it. I think the detection of this problem will be very bright about the structure.

What do you do to add keypad support for editing in the demo?

The easiest way to code on "click" to The event has to change = "press the key" . You can find a list of supported events here:

As you mentioned earlier, you have tabindex hack Use the label element but it seems that labels in Chrome are not tabbed - Firefox and IE are fine.

  {{# item = controller = "todo"}}    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -