Open
Description
Describe the bug
It is not possible to traverse out of the WebKit browser using Tab / Shift-Tab.
To Reproduce
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
public class FocusProblem {
public static void main(String[] args) {
Shell shell = new Shell(Display.getDefault());
shell.setLayout(new GridLayout(1, true));
Browser browser = new Browser(shell, SWT.EDGE);
GridDataFactory.fillDefaults().grab(true, false).applyTo(browser);
browser.setText("browser");
Button button = new Button(shell, SWT.PUSH);
button.setText("button - try to reach me via keyboard!");
Text text = new Text(shell, SWT.NONE);
text.setText("text - try to reach me via keyboard!");
GridDataFactory.fillDefaults().grab(true, false).applyTo(text);
shell.open();
browser.forceFocus();
while (!shell.isDisposed()) {
if (!shell.getDisplay().readAndDispatch()) {
shell.getDisplay().sleep();
}
}
}
}
It's not possible to use Tab / Shift-Tab to navigate away from the browser to the Button or Text.
Expected behavior
Traverse listeners should work
Environment:
- Select the platform(s) on which the behavior is seen:
-
- All OS
-
- Windows
-
- Linux
-
- macOS
- Additional OS info (e.g. OS version, Linux Desktop, etc)
Noticed by adding test for Edge: Focus is lost when Browser is made the focus control immediately after construction #1640.