Generally, the decision tree for this sort of thing is:

1) Does it also happen in Firefox and IE?
If yes: not a bug.
2) Does it happen in one of Firefox or IE?
If yes: probably not a bug, might wanna bring it up if the behavior
seems really broken.
3) Does it happen in Safari but not Firefox/IE?
If yes: WebKit bug.  See their bug reporting guidelines:
http://webkit.org/quality/reporting.html
4) Does it happen in only Chrome, but not any of the above browsers?
If yes: file a Chrome bug.

I should put this up on the dev site somewhere.  The short answer to
your question is that no, this isn't the right forum, but I can't
blame you for not knowing that.  :)

On Sat, Dec 5, 2009 at 9:32 AM, nachumk <nach...@gmail.com> wrote:
> Hi,
>
> I hope this is the right forum for this question...
> I am using Chrome Dev 4.0.249.25.
>
> I am creating a small floating menu and I want to detect when someone
> clicks outside of it. The way I detect if someone clicks out of the
> menu is by registering a window click event (window.addEvent...
> ('click')) and I test if event.target is equal to the original menu
> object (or a child of it). This worked on the Chrome beta version
> that
> I previously installed, but now with the dev version I see that the
> event is not the original event element but some type of copy that no
> longer validates with a (event.target == paramElement).
>
> sample code:
> //creating menu:
> var menu = document.createElement('div');
> myAddChildren(menu);
> window.addEventListener('click', function(event) { removeMenu(event,
> menu); }, false);
> document.body.appendChild(menu);
>
> //removing menu:
> function removeMenu(event, menu) {
>  //event.target is never equal to menu even when it should be!!!
> if((event.target == menu) || (myIsChild(menu, event.target)))
>  return //don't remove if click is on menu itself or a child of menu
> window.removeEventListener('click', arguments.callee.caller, false);
> document.body.removeChild(menu);
>
> I also noticed that if I add a custom variable to the menu object it
> doesn't show up under event.target when clicked. I have also verified
> that the element clicked is the actual menu as opposed to a child. I
> can verify this via the className which is set to the menu class type.
> The test that previously passed and *** should *** pass is
> (event.target == menu).
>
> The effect is that I want the menu to stay open so long as I've not
> clicked out of it. A click inside of it should keep it open. I know
> this sounds strange and it's not the way it will be in the end, but
> it's important for now.
>
> Thanx,
> nachum
>
> --
> Chromium Developers mailing list: chromium-dev@googlegroups.com
> View archives, change email options, or unsubscribe:
>    http://groups.google.com/group/chromium-dev
>

-- 
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev

Reply via email to