Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submenu close delay not activated when mouse moves out of menu #125

Open
jasongrout opened this issue Oct 22, 2020 · 0 comments
Open

Submenu close delay not activated when mouse moves out of menu #125

jasongrout opened this issue Oct 22, 2020 · 0 comments

Comments

@jasongrout
Copy link
Contributor

Consider these two paths of mouse movement:

Screen Shot 2020-10-22 at 10 22 24 AM

In the blue path, the submenu delays closing so you can get to the submenu item you are aiming for. However, if the mouse goes on the red path, the menu closes and a new top-level menu opens. This is frustrating if you are aiming for a submenu item.

Perhaps the delay at

/**
* Start the open timer, unless it is already pending.
*/
private _startOpenTimer(): void {
if (this._openTimerID === 0) {
this._openTimerID = window.setTimeout(() => {
this._openTimerID = 0;
this._openChildMenu();
}, Private.TIMER_DELAY);
}
}
/**
* Start the close timer, unless it is already pending.
*/
private _startCloseTimer(): void {
if (this._closeTimerID === 0) {
this._closeTimerID = window.setTimeout(() => {
this._closeTimerID = 0;
this._closeChildMenu();
}, Private.TIMER_DELAY);
}
}
/**
* Cancel the open timer, if the timer is pending.
*/
private _cancelOpenTimer(): void {
if (this._openTimerID !== 0) {
clearTimeout(this._openTimerID);
this._openTimerID = 0;
}
}
/**
* Cancel the close timer, if the timer is pending.
*/
private _cancelCloseTimer(): void {
if (this._closeTimerID !== 0) {
clearTimeout(this._closeTimerID);
this._closeTimerID = 0;
}
}
should work if the mouse pointed strays outside of the menu block as well?

See jupyterlab/jupyterlab#9201 for more context.

@jasongrout jasongrout changed the title Submenu close delay not activate when mouse moves out of menu Submenu close delay not activated when mouse moves out of menu Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant