Page 1 of 1

checkbox w/ label onmouseover event

Posted: Mon Oct 13, 2014 6:46 pm
by SeanTyree
I think there might be an issue with the onmouseover event on the label portion of a checkbox w/ label. I haven't had a chance to test on 5.0.1 yet, but in 4.8.4 the onmouseover does not fire on the label portion. Is this by design?

My workaround for this issue was to create separate label widgets and code the onmouseover on both the checkbox and label.

Sean

Re: checkbox w/ label onmouseover event

Posted: Tue Oct 14, 2014 10:27 am
by Scott Klement
I must admit that I don't know what the original intention was, here.

Under the covers, Profound UI will create two separate HTML objects, an <input> tag for the check box, and a <label> tag for the label. So if you wanted the 'onmouseover' to work on both, you'd have to enclose them both inside a <div> or similar and put the onmouseover on that div. Otherwise, it'd potentially fire twice (once when the user moves the mouse over the checkbox, and again when the user puts the mouse over the label)

I'd be worried about changing this as it might break compatibility with existing applications?

Your solution of putting out two separate widgets (one for the checkbox and one for the label) seems like it's a good way to do it. (I'm assuming that you don't mind the onmouseover potentially firing twice, it won't hurt anything in your particular application.)

Re: checkbox w/ label onmouseover event

Posted: Tue Oct 14, 2014 1:34 pm
by SeanTyree
Scott, since the onmouseover events are firing independantly, I do not have a problem with 2 widgets (I have the same code behind each of them anyway).

I can see why some applications would not want to fire on the label since it is the non-functional part of the widget.

Thanks for looking into this,
Sean