| Summary: | [ClientScripting][Text] setSelection and getSelection do not work correctly in Modify event | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Tim Buschtoens <tbuschto> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | tbuschto |
| Version: | 2.1 | ||
| Target Milestone: | 2.1 M2 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
The values of getSelection within a Modify event may also be incorrect. They are sometimes off by one, especially when starting to write in an empty field, or when using backspace. Even eith the setTimeout workaround the actually rendered selection is sometimes off by one. The getter issue is webkit only. Fixed with commit 240d12ef886c3f6bebdc0205dbf0ce3475b06562 (RAP repository). Change event is now fired with a delay so the selection values on the input element are already updated. This also seems to fix the issue with setSelection. |
The follwing does not work in a Modify client event: widget.setText( "foo" ); widget.setSelection( [ 1, 2 ] ); But this does: widget.setText( "foo" ); window.setTimeout( function() { widget.setSelection( [ 1, 2 ] ); }, 0 ); In SWT it works.