On 2/2/17, 3:28 AM, "carlos.rov...@gmail.com on behalf of Carlos Rovira" <carlos.rov...@gmail.com on behalf of carlosrov...@apache.org> wrote:
>HI Alex and Peter for taking the time to see this > >2017-02-02 7:15 GMT+01:00 Alex Harui <aha...@adobe.com>: > >> I think I correctly built a no-Flex HTML&JS test of RadioButtons: >> >> http://home.apache.org/~aharui/Test/MDLRadioButtons.html >> >> You can View Source on it to see if I did it right. >> >> >The source seems right to me > > >> I found out that if I listen to the outer Label, then I get two click >> events. But if I listen to the inner Input, which this example does, >>then >> I only get one click event. So one possible workaround is to override >> addEventListener and listen to the Input for "click". >> >> >I tried that but in our case doesn't work, but don't know why > >In our case the input radio is "icon.element" and we should change >to "icon.element.addEventListener("click", clickHandler, false);" right? I don't think so. If element is the outer Label you haven't changed where you are listening. IMO you would override addEventListener to find the Label's internal Input. There shouldn't be any use of preventDefault or stopPropagation. Something like: Override public function addEventListener(type:String, handler:Function) { If (type == "click") Input.addEventListener(type, handler); Else Super.addEventListener(type, handler); } If that doesn't work for you I will try it myself later. -Alex