https://bugzilla.wikimedia.org/show_bug.cgi?id=30130

--- Comment #16 from Santhosh Thottingal <[email protected]> 
2011-08-21 09:46:59 UTC ---
Created attachment 8953
  --> https://bugzilla.wikimedia.org/attachment.cgi?id=8953
correct the selectionStart postition problem with chrome.

Since we know the correct selectionStart and selectionEnd, we can check the
values returned by the browser by taking a difference. If start-end is not same
as what we passed and we get from browser, that means there is a problem. In
that case the selectionStart value should be the value we know and not the
browser passed value.

I modified the jquery.textSelection.js encapsulateSelection method to accept
two more optional arguments- selectionStart and selectionEnd. And avoided
calling setSelection method from ext.narayam.core.js. The encapsulateSelection
method will check for those extra options and will set the selection. Then
compare the range values returned by browser and what we passed as options. If
there is a mismatch , correct the startPos and proceed. 

A quick test showed that it is working. I hope I did not break anything.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to