| Summary: | [Text] Wrong selection start in IE under some constellation | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | DANIEL <daniel.eclipse> | ||||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | ||||||||
| Version: | unspecified | ||||||||
| Target Milestone: | 1.4 M7 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
DANIEL
Created attachment 183607 [details]
SampleView.java
Created attachment 183608 [details]
ActionCopy.java
This is reproducible with Controls Demo too. Tested with IE9. After some investigation I found that the problem is in TextField.js#getSelectionStart(). In case of IE and string ends with "\r\n" the vRange.text.length is two chars shorter. This leads to additional two chars offset in final result: len - vRange.text.length. After searching the web, it seems that this is a known problem in IE (for some reason IE doesn’t always count the \n and \r in the length). Changed TextField.js#getSelectionStart() IE part to proper return the selection start. JS test added. Tested in IE9, IE8 and IE6. |