flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Ent <p...@adobe.com>
Subject Re: [FlexJS] Click Event (Att: Alex and Peter) (was: Re: [FlexJS] RadioButton click event)
Date Tue, 31 Jan 2017 19:05:25 GMT
The MDL radio button is composed as:
<label Š>
	<input Š>
	<span Š>Label You See</span>
	<span Š>

The first click event has target=<span>, currentTarget=<label> while the
second click event has target=<input>, currentTarget=<label>. The click is
being dispatched from the input Radio (or Check) and from the label that's
identifying it.

In DataBindingExample, which uses the HTML.RadioButton, events come
through BrowserEvent which are then relayed to the proper event handler. I
spent some time tracing through this because it is, to me, obscure how
this happens. I'm not sure why MDL isn't automatically get BrowserEvent.


On 1/31/17, 4:09 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlosrovira@apache.org> wrote:

>Alex, Peter,
>we're having some problems with MDL RadioButton click event.
>I implement RadioButton in mdl as a fork of the HTML one (they both share
>the same parent class and structure, so MDL does not extend RB HTML)
>As the rest of toggle components all has "change" and "click" events.
>Change use to work ok (no problem at all with that), but click use to give
>us problems. In Checkbox we had the problem that click was throwing two
>times so we make a workaround in the handler with preventDefault and
>In RB Piotr could fix the issue deselecting all RBs in a group. so again
>had to do manual. Maybe we could go with this implementation for now. but
>it motivated me to send this email.
>I think we don't understand the base in FlexJS and why is happening this
>issue with click event. For this reason we can't implement a solution that
>could be the best one, or one that does not look a bit "hacky"
>Hope you could give us some clue about what's happening here so we could
>understand and act accordingly
>2017-01-31 0:28 GMT+01:00 piotrz <piotrzarzycki21@gmail.com>:
>> Hi Carlos,
>> I just pushed fixed for double click event on RadioButton, but it's not
>> ideal. With this fix our "selected" property won't work.
>> My solution:
>> - Getting all Radio buttons in group and deselect all radio (I'm using
>> script function not "selected" property - that's why in unselection
>> our selected property is untouched) - Look into the "unselectAll"
>> -
>> maybe you will have some other idea.
>> - I'm selecting clicked element
>> Here is what I see without my fix. Our event listener is fire two times
>> source of our event is from
>> <http://apache-flex-development.2333347.n4.nabble.
>> com/file/n58814/radio_click.png>
>> goog.events.handleBrowseEvent function inside events.js - This function
>> fire two times in our ElementWrapper - fireListenerOverride. - Not sure
>> why.
>> Piotr
>> -----
>> Apache Flex PMC
>> piotrzarzycki21@gmail.com
>> --
>> View this message in context: http://apache-flex-
>> development.2333347.n4.nabble.com/FlexJS-RadioButton-click-
>> event-tp58731p58814.html
>> Sent from the Apache Flex Development mailing list archive at
>Carlos Rovira

View raw message