Community
Participate
Working Groups
Browser : Firefox 42.0 Snippet : public class BasicEntryPoint extends AbstractEntryPoint implements Listener{ private String[] content = new String []{"Bonjour", "Hello", "Gueten Tag", "Goeiedag"}; private Combo combo; @Override protected void createContents(Composite parent) { parent.setLayout(new GridLayout(1, false)); combo = new Combo(parent, SWT.BORDER); combo.setItems(content); combo.select(0); combo.addListener(SWT.FocusIn, this); } @Override public void handleEvent(Event event) { Point selection = combo.getSelection(); System.out.println(selection); // if (selection.x != 0 || selection.y != combo.getText().length()){ // combo.setSelection(new Point(0,combo.getText().length())); // } } } Scenario 1 : - Focus In the combo - Select the full text - Focus out - Click on the text in the combo and focus in again Result : On the second focus in event, the text quickly flashes as fully selected, but the text is, in the end, unselected with the cursor set at the mouse click position. This differs from RCP behaviour (text is selected). This is also incoherent with the selection value (put a break point in the handle event method and inspect the selection value). Scenario 2 : - Focus In the combo - Select the full text - Focus out - Click in the tiny space between the combo border and the text selection area. Result : Text is fully selected.
That's how browser native input field works - selection is removed when you click (set caret position) on it. I don't think that we can do anything about it.
The problem is that the widget on server side does not reflect the selection state in the browser. Try to set the full selection on the focusIn event (uncomment the three lines).