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

Firefox: Files in menu items (such as explorer) are opened on mouseup, not onclick #180833

Open
nicofrand opened this issue Apr 25, 2023 · 6 comments · May be fixed by #211245
Open

Firefox: Files in menu items (such as explorer) are opened on mouseup, not onclick #180833

nicofrand opened this issue Apr 25, 2023 · 6 comments · May be fixed by #211245
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug firefox Issues running VSCode in Web on Firefox help wanted Issues identified as good community contribution opportunities list-widget List widget issues web Issues related to running VSCode in the web
Milestone

Comments

@nicofrand
Copy link

Hi!

When I select a line in the editor I often start my selection from the end of the line, pressing the mouse left button and go to the beginning of the line and release the mouse button. However I go further than the beginning of the line to be quick and my cursor is on the left panel (ex: Explorer).

When I release the mouse button this triggers a mouseup event in the panel, for example an extension, which causes it to open in the editor (thus switching the active file being edited).

Example with this code:

/**
 * @class mynamespace.Component class
 */
mynamespace.Component = function () {
	
};

/**
 * Fires a <i>onComponentTitleChanged</i> event on all registered listeners.
 * @private
 */
mynamespace.Component.prototype._fireTitleChanged = function () {
	this._listeners.forEach(l => {
		if (l.onComponentTitleChanged) {
			l.onComponentTitleChanged(this, this._title);
		}
	});
};

/**
 * Fires a <i>onComponentIconChanged</i> event on all registered listeners.
 * @private
 */
mynamespace.Component.prototype._fireIconChanged = function () {
	this._listeners.forEach(l => {
		if (l.onComponentIconChanged) {
			l.onComponentIconChanged(this, this._icon);
		}
	});
};

/**
 * Fires a <i>onComponentResized</i> event on all registered listeners.
 * @private
 */
mynamespace.Component.prototype._fireResized = function () {
	this._listeners.forEach(l => {
		if (l.onComponentResized) {
			l.onComponentResized(this);
		}
	});
};

/**
 * Fires a <i>onComponentMinimized</i> event on all registered listeners.
 * @private
 */
mynamespace.Component.prototype._fireMinimized = function () {
	this._listeners.forEach(l => {
		if (l.onComponentMinimized) {
			l.onComponentMinimized(this, this._isMinimized);
		}
	});
};

/**
 * Fires a <i>onComponentMaximized</i> event on all registered listeners.
 * @private
 */
mynamespace.Component.prototype._fireMaximized = function () {
	this._listeners.forEach(l => {
		if (l.onComponentMaximized) {
			l.onComponentMaximized(this, this._isMaximized);
		}
	});
};

/**
 * Fires a <i>onComponentClosed</i> event on all registered listeners.
 * @private
 */
mynamespace.Component.prototype._fireClosed = function () {
	for (var i = this._listeners.length - 1; i >= 0; --i) {
		var l = this._listeners[i];
		if (l.onComponentClosed) {
			l.onComponentClosed(this);
		}
	}
};

See this gif: I select some code then release the mouse button over the "Jupyter" item in the extensions panel, which opens it on the right side.

bug-vscode

This only happens in vscode.dev (or other web versions of it), not the desktop vscode app.

(Initially opened in gitpod-io/gitpod#10559)

Version: 1.77.3
Commit: 704ed70
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0
Embedder: vscode.dev

@joaomoreno
Copy link
Member

I can't repro this on macOS/Safari. On what browsers can you repro this?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Apr 26, 2023
@nicofrand
Copy link
Author

Hi,

in Firefox (the user-agent was provided (User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0) but that happens in several versions of it.

@joaomoreno
Copy link
Member

Can you repro on a Chromium based browser?

@nicofrand
Copy link
Author

No I do not.

@joaomoreno joaomoreno changed the title Files in menu items (such as explorer) are opened on mouseup, not onclick Firefox: Files in menu items (such as explorer) are opened on mouseup, not onclick Apr 26, 2023
@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug web Issues related to running VSCode in the web firefox Issues running VSCode in Web on Firefox and removed info-needed Issue requires more information from poster labels Apr 26, 2023
@joaomoreno joaomoreno added this to the Backlog milestone Apr 26, 2023
@joaomoreno joaomoreno added list-widget List widget issues help wanted Issues identified as good community contribution opportunities labels Apr 26, 2023
@antonioprudenzano
Copy link
Contributor

antonioprudenzano commented May 1, 2023

It actually triggers a click event when releasing mouse click.
Happens even if you do the same steps while using the editor scrollbar.

@pnhalim
Copy link

pnhalim commented Apr 24, 2024

Hi, I am looking into this issue with @JoelSon1014

It looks like this happens when the following steps are done

  1. open in Firefox
  2. start at any draggable object (text selection, scrollbar, minimap to the right)
  3. release the mouse while on top of most sidebar buttons, status bar buttons (bottom), action view items (top right), and also the command center input

I am currently working on a solution that tracks whether the button's mouseOver event was activated (only in Firefox). It seems that the mouseOver event does not occur while a draggable object is selected, so we can use this to ensure that buttons are only clicked when not dragging (when the mouseOver event did occur).

I will submit a pull request soon. I've gotten the correct functionality working for almost all of the buttons, with a few exceptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug firefox Issues running VSCode in Web on Firefox help wanted Issues identified as good community contribution opportunities list-widget List widget issues web Issues related to running VSCode in the web
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants