webkit clears the current selection when click the address bar or search box, it works fine under chrome, firefox, and safari on windows
steps to reproduce:
1. open safari and browse to a editable html file which body has attribute contentEditable="true"
2. select some text
3. click address bar or search box
4. the selection of html has been cleared
it happens on safari, and webkit which I embed in a wxWidgets application using wxWebkitCtrl, I'm not sure if this is a bug or it's by design.
or is there any work around to avoid this?
os: mac osx 10.5
This behavior seems correct to me - a single window shouldn't have multiple selections.
What I'm trying to do is embed the webkit in a desktop application(using wxwidgets), and then I added dialogs and other property editor to maintain the current selection(e.g. image, paragraph).
If the user selected an image, I want to show an image editor beside the html view, then user can change the size or other style of the image.
but if I click the editor(outside of the html view), then the current selection lost, what I expected is make the selection to be inactive, then I can got the selected element.
is that make sense?
I understood your requirement saying that after image selection, your going to invoke the image editor, for modifying the size/style of image, but one thing is that if your editor is part of same window handler where engine and UI interface handle the touch event,then touch co-ordinates send to engine for doing set Selection with respect to touch point, hence as Alexey Proskuryakov mentioned window shouldn't have multiple selections, so this an expected behavior,i think this is an invalid case.
Suggestion is that make different touch handler for both the entity.