- Summary:
-
The inline editor no longer activates when selecting text.The inline editor no longer activates when selecting text
- Testing Done:
-
+ Chrome 19.0.1068.1 Linux
+ Firefox 11.0 Linux
The inline editor no longer activates when selecting text
Review Request #2991 — Created March 21, 2012 and submitted
The inline editor no longer activates when selecting text. Mouse events are monitored to check if the user is simply clicking on the editor box, or is dragging to copy text in the editor text area.
Latest Chrome, Firefox, Opera - Linux Not tested on touch devices.
Description | From | Last Updated |
---|---|---|
Instead of using this mousedown/mousemove/mouseup combination, could you use dragstart/mouseup? That might be simpler. |
mike_conley | |
A style issue, .mousedown could be on a new line and indented (along with .mouseup). |
ME medanat | |
I think the return false should be outside the if statement to prevent the event bubbling. Mousedown might also need … |
ME medanat | |
Blank line after variable declarations. |
chipx86 | |
Can getSelection() ever return null/undefined? |
chipx86 | |
The "selection ==" should be on the following line. |
chipx86 | |
Blank line between these. |
chipx86 |
- Change Summary:
-
Much cleaner code for the inline editor not activating when selecting text.
- Diff:
-
Revision 2 (+17 -3)
- Change Summary:
-
New method.
- Description:
-
The inline editor no longer activates when selecting text.
~ This is fixed by monitoring mousemove events, and only opening the editor
~ This is done by monitoring if there is a new text selection, and keeping the editor closed if there is.
- if the mouse was not moved.
- Change Summary:
-
Now also checks for a left-click.
- Description:
-
The inline editor no longer activates when selecting text.
~ This is done by monitoring if there is a new text selection, and keeping the editor closed if there is.
~ Text selection in the editor box are monitored, and the editor won't open if text is selected. The mouse button is also monitored.
- Testing Done:
-
~ Chrome 19.0.1068.1 Linux
~ Latest Chrome, Firefox, Opera - Linux
- Firefox 11.0 Linux - Diff:
-
Revision 4 (+20 -4)
-
One case this still doesn't fix is if you start selection, and then in the same drag, unselect it all. Valid operation, but it would cause this to open. I think what I like much better than storing the selection and comparing is to listen for a click, and listen for a selectstart. If selectstart happens, set a flag. On click, if the flag is set, ignore. If not set, open.
-
-
-
-
- Change Summary:
-
Moved back to a modified version of my original idea. isDragging now starts at "true" so if you are selecting outside and drag inside, the editor will not activate.
- Description:
-
The inline editor no longer activates when selecting text.
~ Text selection in the editor box are monitored, and the editor won't open if text is selected. The mouse button is also monitored.
~ Mouse events are monitored to check if the user is simply clicking on the editor box, or is dragging to copy text in the editor text area.
- Testing Done:
-
Latest Chrome, Firefox, Opera - Linux
+ + Not tested on touch devices.
- Diff:
-
Revision 5 (+21 -4)