Closed Bug 1430892 Opened 8 years ago Closed 3 years ago

Clicking on select tag sometimes it closes automatically selecting the option under the pointer

Categories

(Core :: Widget: Cocoa, defect, P2)

Desktop
macOS
defect

Tracking

()

VERIFIED FIXED
110 Branch
Tracking Status
firefox110 --- verified
firefox111 --- verified

People

(Reporter: orlando, Assigned: spohl)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:57.0) Gecko/20100101 Firefox/57.0 Build ID: 20180103231032 Steps to reproduce: Here's a video https://monosnap.com/file/4T7Fkx9qIrt2dIctiiHdCcaf1YVo8W OS: macOS High Sierra 10.13.2 Browser: Firefox Quantum 57.0.4 (with our without safe mode) Steps: 1. Click on a select 2. Sometimes it closes selecting the first option under the pointer Actual results: 1. Click on a select 2. Sometimes it closes selecting the first option under the pointer Expected results: 1. Click on a select 2. To select an option, it should require another click
Version: 1.4 Branch → 57 Branch
Version: 57 Branch → unspecified
Do you have a site where this reproduces? Does this reproduce with the dropdowns in bugzilla?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(orlando)
Priority: -- → P2
A basic select input will do https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select Yes, this happens also in the select inputs in bugzilla. https://monosnap.com/file/bntyWk0pERL4leJ7LUcOdNfbFiEjOz I think you can reproduce my moving your mouse a bit after you click the selection. I can't reproduce this behaviour in Chrome.
Flags: needinfo?(orlando)

This is trivially reproducible in Firefox, Chrome, and Safari, almost 100% of the time: move the mouse while clicking on the select. If you move the mouse far enough, you select a different option.

If you're using a sensitive mouse, it's easy to do this unintentionally. It's harder to do unintentionally if using a trackpad. And if you're using a trackball, you probably will never do it unintentionally, but it's easy to do intentionally.

My question then, since this seems to be common across browsers: is this in fact the "expected" behaviour? And if so, how to disable it?

I think one reason this happens sometimes is that we call maybeRollup here

https://searchfox.org/mozilla-central/rev/9f074fab9bf905fad62e7cc32faf121195f4ba46/widget/cocoa/nsChildView.mm#3471

This happens when you do two finger scrolling on the touchpad. In my testing neither Chrome nor Safari rollup the drop down in this situation. They ignore the scroll instead.

There is a similar situation for pinch gestures, Chrome and Safari ignore them when a dropdown is open. In

https://hg.mozilla.org/mozilla-central/rev/2d1ff1c60749f49ecf0a14c97f24f0b69dcdd48f

I made us rollup in this situation for consistency and because it seemed easier to do.

Do you think we should change this behaviour to be more like Chrome and Safari?

Flags: needinfo?(spohl.mozilla.bugs)

(In case you're asking me ...) Perhaps you're right about maybeRollup being invoked in this situation, but would that be from line 3471? This issue is about about accidentally (or deliberately) nudging the mouse pointer when you click on a select, and this problem occurs when using a mouse or a trackball without in any way "scrolling". I'd be surprised if the function scrollWheel:(NSEvent*)theEvent were being called in this case. (But I'm open to surprises.)

OK, the behaviour seems to be the same as you observe if you slow it right down. E.g., go to the w3schools example mentioned in comment 2. Position the mouse cursor over the middle of the select, mouse down (which opens the select), then move the mouse slightly left or right, then mouse up. The select closes again, even though you've only done a total of one mouse click. Or, click-and-hold, then while holding down the mouse button, move the mouse over a different option, then release the button; the select closes. So this is what seems to happen, but much faster, if you click and just happen to "nudge" the mouse as you click. If so, then the "problem" could be "addressed" by reducing the "sensitivity" of the detection of cursor motion.

If by "more like Chrome and Safari" that means:

  • the slowed-down behaviour is regarded as "correct", or, at least, isn't going to change any time soon,
  • noting that the slowed-down behaviour in Firefox is already the same as in Chrome and Safari
  • in the case of the "click and nudge" behaviour, the behaviour can also be triggered in Chrome and Safari, but the "sensitivity" of the nudging is less in Chrome and Safari,

then yes, make Firefox less "sensitive" to nudging the mouse pointer while clicking on a select.

(In reply to Timothy Nikkel (:tnikkel) from comment #4)

I think one reason this happens sometimes is that we call maybeRollup here

https://searchfox.org/mozilla-central/rev/9f074fab9bf905fad62e7cc32faf121195f4ba46/widget/cocoa/nsChildView.mm#3471

This happens when you do two finger scrolling on the touchpad. In my testing neither Chrome nor Safari rollup the drop down in this situation. They ignore the scroll instead.

There is a similar situation for pinch gestures, Chrome and Safari ignore them when a dropdown is open. In

https://hg.mozilla.org/mozilla-central/rev/2d1ff1c60749f49ecf0a14c97f24f0b69dcdd48f

I made us rollup in this situation for consistency and because it seemed easier to do.

Do you think we should change this behaviour to be more like Chrome and Safari?

Sorry for the delay here. Yes, I believe it would be preferable to mirror Chrome and Safari in this instance. Thank you for pointing this out!

Flags: needinfo?(spohl.mozilla.bugs)

Hey, guys!
I'm with the same problem on Firefox 80.0.1 at Mac OS Catalina 10.15.6.
What is being done about this issue?

Here's a demo page that is 100% reproducible for me: https://cam-narzt.github.io/select-problem/

firefox 84.0b4 (64-bit) on macOS 10.15.7 (19H15)

Has anybody encountered this issue with the touchpad, or is this mostly affecting mouse users?

It seems like the native menu used in Chrome and Safari has a higher mouse move tolerance before it interprets a wiggly click as an open-drag-select gesture.

Our code to prevent instant-close on regular (non-wiggly) clicks is here:
https://searchfox.org/mozilla-central/rev/168c45a7acc44e9904cfd4eebcb9eb080e05699c/layout/xul/nsMenuFrame.cpp#340-349

It seems like we could tweak that code to take the movement distance into account.

It used to happen frequently to me on a touchpad, I haven't noticed it as much since I upgraded macs.

Attached file Bug 1430892 - WIP

TODO: Store the mousedown event's information in gMenuOpeningMouseDownData

In my example, I cannot get the dropdown to stay open with a trackpad, not even with a perfectly stationary cursor.

Oh, weird! I can't reproduce that at all. With the trackpad it always stays open for me. Do you press down on the trackpad or do you use "Tap to click" (can be enabled in the Trackpad preferences)?

(In reply to Cam from comment #8)

Here's a demo page that is 100% reproducible for me: https://cam-narzt.github.io/select-problem/

I can reproduce with this 100% of the time. I don't have tap to click enabled.

I do not have tap to click enabled.

Because I was curious, I enabled tap-to-click and tried my demo, but got the same results. The dropdown just immediately closes, you can barely even see it flash.

Flags: needinfo?(tnikkel)
Severity: normal → S2

Same issue.

MacOS: Big Sur 11.1
Firefox: Developer 85.0b4
Device: Apple Magic Mouse

Spent the past hour looking for resolution to this issue and stumbled upon this PR. 100% reproducible here on macOS.

I hit this issue constantly, trying to get a menu pull-down and am already moving to select some item from the list. Triple-flash, menu closes, face grimaces.

Same issue.
Device: Apple Magic Mouse

Also repro for me on Mac
FF 92.0.1
Mac OS Big Sur v 11.6

It seems to be that on FF, the browser allows you to scroll the page when a dropdown is open, and it automatically closes the dropdown. On Chrome, they appear to have disabled scrolling the page when a dropdown is open. So I guess that is why it doesn't happen on Chrome.

Thanks,
Ali

Fixed for me in FF100.b4

(In reply to Cam from comment #21)

Fixed for me in FF100.b4

Would you be able to run mozregression to see when this was fixed? Let me know if you need any instructions on how to run it.

Flags: needinfo?(camden.narzt)

It seems to be that on FF, the browser allows you to scroll the page when a dropdown is open, and it automatically closes the dropdown. On Chrome, they appear to have disabled scrolling the page when a dropdown is open. So I guess that is why it doesn't happen on Chrome.

This issue is independent of the noted "close on scroll" effect. It occurs with selects that are not within scrollable content.

Fixed for me in FF100.b4

I can still reproduce easily in 100.0b5. It's slightly more difficult to reproduce here -- https://cam-narzt.github.io/select-problem/ -- because the area of selectable options is relatively small and "Roles" is not selectable. Moving the cursor slightly sideways while clicking on an already selected option (e.g. "admin") is an easy way for me to reproduce. A larger select dropdown, with no non-selectable items makes it easier to reproduce.

It's possible to reproduce this exact same issue in Chromium and Safari, both are just significantly less "sensitive" - the cursor needs to move much farther quickly. It seems both browsers have a larger threshold of movement required

I have this exact same issue. Can be reproduced using my MX Master mouse or M1 Macbook Pro touchpad 100% of the time.

It occurs when the mouse is still in motion after clicking the select field - even if ever so slightly.

Only solution I've had is to long-click on select fields.

We need this to get fixed! Doesn't occur on Chrome at all.

This is the ONE reason I cannot use FireFox and I'm stuck with Chrome. This has happened with various mice, mostly expensive mice... but I don't have any cheap mice to test. It happens on the basic of basic form selects.

In my opinion, when you click on a select, and the options present, unless you click on an option, or click outside the options, or hit enter, that list should stay open just waiting for some interaction.

In my trials with FireFox, I'll click on the select to open and immediately move my mouse to the proper selection, and during this movement, something will just select automatically, without even a mouse click. I used FireFox way back, and never had issues like this. I'm on an M1 Mac.

Duplicate of this bug: 1600815

Not fixed for me... just tried it, still random selections.

Assignee: nobody → spohl.mozilla.bugs
Status: NEW → ASSIGNED

Redirect a needinfo that is pending on an inactive user to the triage owner.
:spohl, since the bug has high priority, high severity and recent activity, could you please find another way to get the information or close the bug as INCOMPLETE if it is not actionable?

For more information, please visit auto_nag documentation.

Flags: needinfo?(mozilla.bugzilla) → needinfo?(spohl.mozilla.bugs)

I need to work through some test failures and will post an updated patch at that time.

Flags: needinfo?(tnikkel)
Flags: needinfo?(spohl.mozilla.bugs)
Pushed by spohl@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f56022f0cbb2 Prevent accidental selection of an item in a dropdown menu and closing the menu on macOS. r=mstange
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
Flags: qe-verify+
OS: Unspecified → macOS
Hardware: Unspecified → Desktop

This bug was reproduced with Magic Mouse in Nightly v84.0a1 and verified in BEta v110.0b5 and Nightly v111.0a1 in MacOS 11.6.8.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: