You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Harbs <ha...@gmail.com> on 2018/09/13 08:30:08 UTC

Re: [royale-asjs] 05/06: try listening for both click or mouseup. Menu needs mouse up probably because it is gone before click comes through

This causes two events to be fired when an item renderer is selected.

Mouse up causes the event to be fired even when you mouse down outside the item renderer and then mouse up inside the item renderer. I changed it from mouse up to click in June.

What was the exact issue that you were trying to fix? I’m not sure what the right solution is here, but both events is definitely wrong.

Harbs

> On Sep 7, 2018, at 3:02 AM, aharui@apache.org wrote:
> 
> This is an automated email from the ASF dual-hosted git repository.
> 
> aharui pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
> 
> commit 7d9a1a1330ab6732ae9d7963fb694c5594b5f24d
> Author: Alex Harui <ah...@apache.org>
> AuthorDate: Thu Sep 6 17:01:12 2018 -0700
> 
>    try listening for both click or mouseup.  Menu needs mouse up probably because it is gone before click comes through
> ---
> .../apache/royale/html/beads/controllers/ItemRendererMouseController.as  | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
> index 6073264..f408a71 100644
> --- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
> +++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
> @@ -92,6 +92,7 @@ COMPILE::JS {
> 				goog.events.listen(element, goog.events.EventType.MOUSEOUT, this.handleMouseOut);
> 				goog.events.listen(element, goog.events.EventType.MOUSEDOWN, this.handleMouseDown);
> 				goog.events.listen(element, goog.events.EventType.CLICK, this.handleMouseUp);
> +                goog.events.listen(element, goog.events.EventType.MOUSEUP, this.handleMouseUp);
> 			}
> 		}
> 		
> 


Re: [royale-asjs] 05/06: try listening for both click or mouseup. Menu needs mouse up probably because it is gone before click comes through

Posted by Harbs <ha...@gmail.com>.
Which Menu component is this?

> On Sep 13, 2018, at 11:57 AM, Alex Harui <ah...@adobe.com.INVALID> wrote:
> 
> Menu doesn't seem to get a click.  I think the menu is dismissed on mouseUp so the click never happens.  Your change in June broke menu.
> 
> Why would renderers dispatch the same event on both mouseUp and click?  Seems like they should use one or the other.  It might be that we should change Menu to rely on click and not mouseUp, but that seems like something other people will trip over.
> 
> HTH,
> -Alex
> 
> On 9/13/18, 1:30 AM, "Harbs" <harbs.lists@gmail.com <ma...@gmail.com>> wrote:
> 
>    This causes two events to be fired when an item renderer is selected.
> 
>    Mouse up causes the event to be fired even when you mouse down outside the item renderer and then mouse up inside the item renderer. I changed it from mouse up to click in June.
> 
>    What was the exact issue that you were trying to fix? I’m not sure what the right solution is here, but both events is definitely wrong.
> 
>    Harbs
> 
>> On Sep 7, 2018, at 3:02 AM, aharui@apache.org <ma...@apache.org> wrote:
>> 
>> This is an automated email from the ASF dual-hosted git repository.
>> 
>> aharui pushed a commit to branch develop
>> in repository https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7Cf17b2087bf704cec99d408d619532577%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636724242241298190&amp;sdata=Qg1UtYbkV8GXqaO3hIrxQvbvz%2BynVLx413UMT3qOWtA%3D&amp;reserved=0 <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7Cf17b2087bf704cec99d408d619532577%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636724242241298190&amp;sdata=Qg1UtYbkV8GXqaO3hIrxQvbvz%2BynVLx413UMT3qOWtA%3D&amp;reserved=0>
>> 
>> commit 7d9a1a1330ab6732ae9d7963fb694c5594b5f24d
>> Author: Alex Harui <ah...@apache.org>
>> AuthorDate: Thu Sep 6 17:01:12 2018 -0700
>> 
>>   try listening for both click or mouseup.  Menu needs mouse up probably because it is gone before click comes through
>> ---
>> .../apache/royale/html/beads/controllers/ItemRendererMouseController.as  | 1 +
>> 1 file changed, 1 insertion(+)
>> 
>> diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
>> index 6073264..f408a71 100644
>> --- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
>> +++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
>> @@ -92,6 +92,7 @@ COMPILE::JS {
>> 				goog.events.listen(element, goog.events.EventType.MOUSEOUT, this.handleMouseOut);
>> 				goog.events.listen(element, goog.events.EventType.MOUSEDOWN, this.handleMouseDown);
>> 				goog.events.listen(element, goog.events.EventType.CLICK, this.handleMouseUp);
>> +                goog.events.listen(element, goog.events.EventType.MOUSEUP, this.handleMouseUp);
>> 			}
>> 		}


Re: [royale-asjs] 05/06: try listening for both click or mouseup. Menu needs mouse up probably because it is gone before click comes through

Posted by Carlos Rovira <ca...@apache.org>.
Hi Harbs,

maybe his referring to basic Menu, you can check in examples "MenuExample"
that showcase this component (it was made by Peter)
thanks

El jue., 13 sept. 2018 a las 11:32, Harbs (<ha...@gmail.com>)
escribió:

>
> > On Sep 13, 2018, at 11:57 AM, Alex Harui <ah...@adobe.com.INVALID>
> wrote:
> >
> > Why would renderers dispatch the same event on both mouseUp and click?
> Seems like they should use one or the other.
>
> I don’t get the question. They shouldn’t. Right now they do. They both
> dispatch itemClicked.
>
> > It might be that we should change Menu to rely on click and not mouseUp,
> but that seems like something other people will trip over.
>
> Where’s the Menu code you are talking about?



-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] 05/06: try listening for both click or mouseup. Menu needs mouse up probably because it is gone before click comes through

Posted by Harbs <ha...@gmail.com>.
It ended up being more complicated than that. Cascading menus proved to be a bit tricky. I committed a fix which I think resolves it. (There was a declaration missing in CSS which caused a RTE.)

Harbs

> On Sep 13, 2018, at 1:15 PM, Harbs <ha...@gmail.com> wrote:
> 
> I’m guessing you’re talking about MenuSelectionMouseController.hideMenu_internal().
> 
> I’d fix it by just using setTimeout()
> 
>> On Sep 13, 2018, at 12:30 PM, Harbs <harbs.lists@gmail.com <ma...@gmail.com>> wrote:
>> 
>> 
>>> On Sep 13, 2018, at 11:57 AM, Alex Harui <aharui@adobe.com.INVALID <ma...@adobe.com.INVALID>> wrote:
>>> 
>>> Why would renderers dispatch the same event on both mouseUp and click?  Seems like they should use one or the other.
>> 
>> I don’t get the question. They shouldn’t. Right now they do. They both dispatch itemClicked.
>> 
>>> It might be that we should change Menu to rely on click and not mouseUp, but that seems like something other people will trip over.
>> 
>> Where’s the Menu code you are talking about?
> 


Re: [royale-asjs] 05/06: try listening for both click or mouseup. Menu needs mouse up probably because it is gone before click comes through

Posted by Harbs <ha...@gmail.com>.
I’m guessing you’re talking about MenuSelectionMouseController.hideMenu_internal().

I’d fix it by just using setTimeout()

> On Sep 13, 2018, at 12:30 PM, Harbs <ha...@gmail.com> wrote:
> 
> 
>> On Sep 13, 2018, at 11:57 AM, Alex Harui <aharui@adobe.com.INVALID <ma...@adobe.com.INVALID>> wrote:
>> 
>> Why would renderers dispatch the same event on both mouseUp and click?  Seems like they should use one or the other.
> 
> I don’t get the question. They shouldn’t. Right now they do. They both dispatch itemClicked.
> 
>> It might be that we should change Menu to rely on click and not mouseUp, but that seems like something other people will trip over.
> 
> Where’s the Menu code you are talking about?


Re: [royale-asjs] 05/06: try listening for both click or mouseup. Menu needs mouse up probably because it is gone before click comes through

Posted by Harbs <ha...@gmail.com>.
> On Sep 13, 2018, at 11:57 AM, Alex Harui <ah...@adobe.com.INVALID> wrote:
> 
> Why would renderers dispatch the same event on both mouseUp and click?  Seems like they should use one or the other.

I don’t get the question. They shouldn’t. Right now they do. They both dispatch itemClicked.

> It might be that we should change Menu to rely on click and not mouseUp, but that seems like something other people will trip over.

Where’s the Menu code you are talking about?

Re: [royale-asjs] 05/06: try listening for both click or mouseup. Menu needs mouse up probably because it is gone before click comes through

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Menu doesn't seem to get a click.  I think the menu is dismissed on mouseUp so the click never happens.  Your change in June broke menu.

Why would renderers dispatch the same event on both mouseUp and click?  Seems like they should use one or the other.  It might be that we should change Menu to rely on click and not mouseUp, but that seems like something other people will trip over.

HTH,
-Alex

On 9/13/18, 1:30 AM, "Harbs" <ha...@gmail.com> wrote:

    This causes two events to be fired when an item renderer is selected.
    
    Mouse up causes the event to be fired even when you mouse down outside the item renderer and then mouse up inside the item renderer. I changed it from mouse up to click in June.
    
    What was the exact issue that you were trying to fix? I’m not sure what the right solution is here, but both events is definitely wrong.
    
    Harbs
    
    > On Sep 7, 2018, at 3:02 AM, aharui@apache.org wrote:
    > 
    > This is an automated email from the ASF dual-hosted git repository.
    > 
    > aharui pushed a commit to branch develop
    > in repository https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7Cf17b2087bf704cec99d408d619532577%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636724242241298190&amp;sdata=Qg1UtYbkV8GXqaO3hIrxQvbvz%2BynVLx413UMT3qOWtA%3D&amp;reserved=0
    > 
    > commit 7d9a1a1330ab6732ae9d7963fb694c5594b5f24d
    > Author: Alex Harui <ah...@apache.org>
    > AuthorDate: Thu Sep 6 17:01:12 2018 -0700
    > 
    >    try listening for both click or mouseup.  Menu needs mouse up probably because it is gone before click comes through
    > ---
    > .../apache/royale/html/beads/controllers/ItemRendererMouseController.as  | 1 +
    > 1 file changed, 1 insertion(+)
    > 
    > diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
    > index 6073264..f408a71 100644
    > --- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
    > +++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/controllers/ItemRendererMouseController.as
    > @@ -92,6 +92,7 @@ COMPILE::JS {
    > 				goog.events.listen(element, goog.events.EventType.MOUSEOUT, this.handleMouseOut);
    > 				goog.events.listen(element, goog.events.EventType.MOUSEDOWN, this.handleMouseDown);
    > 				goog.events.listen(element, goog.events.EventType.CLICK, this.handleMouseUp);
    > +                goog.events.listen(element, goog.events.EventType.MOUSEUP, this.handleMouseUp);
    > 			}
    > 		}
    > 		
    >