Bug 19645

Summary: Selected text moved after opening and dismissing context menu (also affects Mail)
Product: WebKit Reporter: Dylan <dylanryan>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: UNCONFIRMED ---    
Severity: Normal    
Priority: P2    
Version: 525.x (Safari 3.1)   
Hardware: Mac   
OS: OS X 10.5   
Description Flags
Test & Steps to reproduce using TextArea or a ContentEditable div none

Description Dylan 2008-06-17 17:19:29 PDT
This happens to me a lot in Mail, but it also happens in Safari. I don't know if it is something in Webkit, or in the way the system handles the events, but since it happens in Safari I thought it'd be good to post it here as a first step.

Basically what is happening is, if I control-click a word to bring up a context menu (usually to check spelling), and then dismiss the context menu by clicking outside of the menu (over some other text), the word I control-clicked (which gets selected when you control-click it) gets moved to where I clicked to dismiss the context menu. It happens in a variety of situations, more or less at random, but I managed to isolate one situation where it happens almost every time if you follow the steps. (Attachment forthcoming).

Further testing narrowed down the cause further. The mouse has to move between the time you press the mouse down to dismiss the context menu and the time you release the button (I guess I move a little too fast sometimes...). What is happening is the mouse down to dismiss the popup menu is treated as if you are clicking the word that is selected, so the mouse move with the button still down drags the word and then places it where you release. Somehow, when the context menu comes up, the next time you press the mouse button it is treated as if it were on the selected word rather than wherever it is. 

If this isn't a Webkit issue, I can submit it to Apple as Mail Feedback, it just seemed that since it affects Safari too it might be a Webkit issue.
Comment 1 Dylan 2008-06-17 17:21:20 PDT
Created attachment 21799 [details]
Test & Steps to reproduce using TextArea or a ContentEditable div