ontap event handler not working with Remote Control

Hi everybody!, I have a simple DataGridList with a GridListImageItem component inside of it. As one of the properties of the GridListImageItem it has an event handler function called in the ontap event, the thing is, it only works when I use the mouse or the touchpad from my laptop. I think it should works with the select button of the remote control too right ??


  • Ok it is actually working, the thing is, inside the event handler I have this code:
    switch(ev.target.id.toString()) { case "application_mainView_gridListImageItem_image_image": this.$.panels.setIndex(1); case "application_mainView_gridListImageItem2_image_image": this.$.panels.setIndex(2); break; }

    to capture what item was clicked. And for some reason, that works only when using the mouse not the remote control
  • The remote emits a keyboard event on the spotted component (the GridListImageItem) whereas your click is emitted from the component you click (usually the image because it's the biggest!). Both events bubble so your handler catches them both but the target is different.

    With DataGridList, you should also get an index property on the event that you can use to disambiguate the source of the event. That's probably the simplest path forward.
  • Exactly! I followed the Moonstone tutorial and fixed the issue using the way they propose to handeling events.. Thank you!
Sign In or Register to comment.