Community
Participate
Working Groups
When using a text widget with a default message, the text field does not handle the focus correctly: The message disappears, but there's no cursor and you also cannot type in any text. You have to click a second time upon the text field to get the cursor. This seems to be an IE (8) issue, since I it works on FF. Sample snippet: public void createPartControl(Composite parent) { parent.setLayout(new RowLayout()); Text text = new Text(parent, SWT.BORDER); text.setMessage("enter"); }
IE8, Safari 4.05 and Opera 10.53 have this problem, Chrome 5.0.396 and FF 3.6.3 work fine.
Created attachment 168129 [details] Proposed patch This patch provides a workaround for the problem. It initializes buffered selectionStart and selectionLenght with zero. Thus, the first time focusing is forced by selection and the selection is set to 0, 0. In addition, this makes all browsers to have the same value returned by TextFiled#getSelectionStart - 0, instead -1 in IE, null in FF.
The patch looks good, please go ahead and commit it.
Applied patch to CVS HEAD.