Trigger clickSelectsAll (if applicable) upon opening textbox context menu

RESOLVED FIXED in mozilla18

Status

()

Toolkit
XUL Widgets
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: fryn, Assigned: fryn)

Tracking

(Blocks: 1 bug, {ux-consistency})

Trunk
mozilla18
x86
Mac OS X
ux-consistency
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

2.84 KB, patch
Neil Deakin
: review+
Details | Diff | Splinter Review
(Assignee)

Description

5 years ago
Created attachment 660561 [details] [diff] [review]
patch

clickSelectsAll (if applicable) should be triggered immediately opening the context menu on platforms for which the context menu opens on mouse down, i.e. OS X and Linux.

This fix blocks fixing bug 695984 (selecting clicked word when opening context menu on OS X).
Attachment #660561 - Flags: review?(mano)
(Assignee)

Comment 1

5 years ago
Comment on attachment 660561 [details] [diff] [review]
patch

Review of attachment 660561 [details] [diff] [review]:
-----------------------------------------------------------------

Steps to reproduce (on OS X):
Two-finger mousedown on the URL bar.

Expected result:
The contents are immediately selected.

Actual result:
The contents are not selected until mouseup, resulting in a janky interaction, where the caret, highlighted region, and context menu item enabled states can be seen to change twice.
Attachment #660561 - Flags: review?(mano) → review?(gavin.sharp)
Attachment #660561 - Flags: review?(gavin.sharp) → review?(enndeakin)

Comment 2

5 years ago
Comment on attachment 660561 [details] [diff] [review]
patch

>+      <handler event="contextmenu">
>+        this._maybeSelectAll();

_maybeSelectAll will get called when someone opens the context menu with the keyboard. For example, if I enable clickSelectsAll on a textbox on linux, tab to it and then press shift+f10, the entire text gets selected and the context menu opens. You'll want to filter out events where button is 0.
(Assignee)

Comment 3

5 years ago
Created attachment 661540 [details] [diff] [review]
patch v2

Filtered out keyboard shortcut case.
Attachment #660561 - Attachment is obsolete: true
Attachment #660561 - Flags: review?(enndeakin)
Attachment #661540 - Flags: review?(enndeakin)

Updated

5 years ago
Attachment #661540 - Flags: review?(enndeakin) → review+
(Assignee)

Comment 4

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/62e6efbdf3c1
Target Milestone: --- → mozilla18
https://hg.mozilla.org/mozilla-central/rev/62e6efbdf3c1
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.