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 "Do not use the I added I have read a lot today, and it looks like Each item may need to specify What do you do to add keypad support for editing in the demo? The easiest way to code 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. title of the item holds
and the label
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"}}
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.)
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
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.
on "click" to
The event has to change = "press the key" . You can find a list of supported events here:
{{# item = controller = "todo"}}
Comments
Post a Comment