Skip to content

V7: Improve VMenuBar click handling logic#11362

Merged
OlliTietavainenVaadin merged 3 commits into
vaadin:7.7from
anasmi:ticket11333_V7
Dec 14, 2018
Merged

V7: Improve VMenuBar click handling logic#11362
OlliTietavainenVaadin merged 3 commits into
vaadin:7.7from
anasmi:ticket11333_V7

Conversation

@anasmi

@anasmi anasmi commented Dec 10, 2018

Copy link
Copy Markdown
Contributor

Backport to V7:

During updateFromUIDL inside MenuBarConnector we empty and re-instantiate the components of MenuBar. When we are modifying the Menubar from the BlurEventListener of another component, we ,by this, remove widgets, therefore clickEvent is not fired and the action of the MenuItem is not proceed as a result. (The BlurEvent is fired before the click event in the chain of events. )

To improve the situation, we catch onMouseDown event , which is fired before BlurEvent,by assigning mouseDown flag to true. Then if no click event has yet happened, we delay the execution of update inside updateFromUIDL by default 500 ms. Then if click event occurs, it proceeds normally. The time can be increased/decreased using setter.

There is no delay, if we are clicking on the MenuBar as usual or no Blur listener is set.

This change allows setting descriptions preserving the action from the MenuItem

(cherry picked from commit 22cc85c)


This change is Reviewable

Anastasia Smirnova added 2 commits December 10, 2018 10:29
Backport to V7:
During `updateFromUIDL` inside MenuBarConnector we empty and re-instantiate the components of MenuBar. When we are modifying the Menubar from the BlurEventListener of another component, we ,by this, remove widgets, therefore clickEvent is not fired and the action of the MenuItem is not proceed as a result. (The BlurEvent is fired before the click event in the chain of events. )

To improve the situation, we catch onMouseDown event , which is fired before BlurEvent,by assigning mouseDown flag to true. Then if no click event has yet happened, we delay the execution of update inside `updateFromUIDL` by default 500 ms. Then if click event occurs, it proceeds normally. The time can be increased/decreased using setter.

There is no delay, if we are clicking on the MenuBar as usual or no Blur listener is set.

This change allows setting descriptions preserving the action from the MenuItem

(cherry picked from commit 22cc85c)
Add missing files from the first commit

Backported to V7:
(cherry picked from commit 22cc85c)
@anasmi anasmi changed the title Improve VMenuBar click handling logic V7: Improve VMenuBar click handling logic Dec 10, 2018
@anasmi anasmi added the v7 label Dec 10, 2018

@OlliTietavainenVaadin OlliTietavainenVaadin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 3 of 3 files at r1, 3 of 3 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants