PDA

View Full Version : [FIXED] Beta 1 - MenuBar behavior - bug, intentional, or unavoidable?



jvahabzadeh
9 Jan 2012, 11:35 AM
There are two oddities that I've noticed with MenuBar, and I don't know if it's intentional or not. These can even be seen in the MenuBar example Ext GWT Explorer Demo for 3.0 Beta. (Beta 2?? I guess I should download it!)

To reproduce the first behavior in question:

Hover over any MenuBarItem EXCEPT for the first one. It will correctly highlight. (in the demo, this would be any of them EXCEPT for File).
Click on the item.
Note that the first MenuBarItem in the MenuBar (in the case of the demo, it's File) briefly highlights, before displaying the contents of the MenuBarItem you actually clicked on.

Is that highlighting of the first item in the MenuBar supposed to happen? It seems like a bug.


To reproduce the second behavior in question:

Hover over any MenuBarItem. It will correctly highlight.
Click on that MenuBarItem. It will correctly show the contents of the MenuBarItem you clicked on.
Move the mouse from the MenuItem you clicked.

Note that the Menu corresponding to the MenuBarItem you originally clicked on does NOT disappear, and the Menu corresponding to the MenuBarItem you're now hovering over does not open and display itself, as would be typical of most applications with a MenuBar.

Is this behavior intentional or not - Or is it something that simply cannot be avoided?

Thanks in advance.

DarekKay
11 Jan 2012, 4:55 AM
I could reproduce that behaviour. I also found 2 other oddities:

First:

Click on a MenuBarItem (File) -> the submenu opens
Click on the same Item again
Normally the submenu should disappear, but it doesn't

Second:

30617

It's not possible to get to a submenu while passing trough an empty space. The submenu closes after arriving the red arrow. That also is not the common behaviour I'd expect. Just try out any well known (desktop) application (like Firefox or Eclipse): if you quickly move your mouse to the submenu it doesn't matter, if you passed through an empty space or even another menu item with another submenu. It's quite irritating to have to move the mouse carefully while any other application would handle fast mouse movements without any problems. I don't know, if you just hadn't thought of it, or if it's not possible to achieve this in a web based application.

jvahabzadeh
12 Jan 2012, 6:26 AM
No, I hadn't thought of that - I never tried, as when I saw the effects I noticed, I'd focused there.

However, I tried your First behavior in Eclipse and in Firefox. The submenu does NOT disappear when you click on the same menu item again. In fact, in a typical application you don't have to click on a menu item to bring up the submenu, it just shows up when the mouse hovers on it (at least on the Windows 7 system I'm using... I don't recall if it's different in other OSes).

As to the Second behavior you noticed - I tried it, and you're right, a "native" application is fine with it if you do it fast enough (or even just move the mouse away from the menu fast enough in a direction such that it doesn't touch any other menu items). Interestingly, if you bring the mouse back over that menu item without touching any other menu items, the submenu will disappear!

In any case, I would suspect that the fact that this is depending on browser events for the mouse movements, hovers, etc., that this is something that would be difficult, if not impossible, to implement. After all, wouldn't it require some sort of thread acting as a timer, to see how quickly something was done? That's not part of the Java subset that GWT supports, but I'm only guessing as to how it would have to be implemented.

DarekKay
12 Jan 2012, 7:15 AM
No, I hadn't thought of that
By "you" I meant the sencha developers ;)


However, I tried your First behavior in Eclipse and in Firefox. The submenu does NOT disappear when you click on the same menu item again. In fact, in a typical application you don't have to click on a menu item to bring up the submenu, it just shows up when the mouse hovers on it (at least on the Windows 7 system I'm using... I don't recall if it's different in other OSes).
I mean the MenuBar-Items and its submenu. So for example the "File" button, which opens a submenu ("New", "Open File"). Click on File, click again and the menu disappears (as it should). Any other MenuItem having an own submenu (like the "Open File" menu item) doesn't share that behaviour, which also is ok. The point is to having a way to just go back without having to click somewhere else.

A very abstract example, where it would be necessary:
1. assign a ClickHandler on the whole content panel of the browser
2. hide all browser features like title and status bar, except the menu bar
3. also assume, the menubar is full, so there are no spaces before, between or after the menubar-items
4. now there is just no way to close the menu without firing the click listener, once opened

DarekKay
29 Mar 2012, 5:23 AM
All "bugs" still exist in RC. At least the issue described by jvahabzadeh should be fixed, since it's not your desired behaviour I guess ;)

WesleyMoy
2 Apr 2012, 7:58 PM
Thanks for the writeup. I've taken a look at each of these issues and have filed a ticket for each. Here are the issues:


First menu bar item highlights when any menu bar item is clicked
Hovering over a menu bar item when a menu is showing doesn't replace the showing menu
Moving the mouse cursor in a straight line from menu to submenu causes the submenu to hide


The first of these is a bug. The latter two are expected behaviour, as they work in a manner typical of menus in older operating systems. However, they're due to be reexamined and to be brought in line with menus in modern operating systems.