| Index: tracing/tracing/ui/base/overlay.html
|
| diff --git a/tracing/tracing/ui/base/overlay.html b/tracing/tracing/ui/base/overlay.html
|
| index 9a03812b53c5a0da6b24e2dfa142001b011c9533..4f842ca4f71bd47db3d1bae7eb33fe4a79af6ddd 100644
|
| --- a/tracing/tracing/ui/base/overlay.html
|
| +++ b/tracing/tracing/ui/base/overlay.html
|
| @@ -268,8 +268,19 @@ tr.exportTo('tr.ui.b', function() {
|
| },
|
|
|
| onFocusIn_(e) {
|
| - if (e.target === this) return;
|
| + // Prevent focus from leaving the overlay.
|
| +
|
| + let node = e.target;
|
| + while (node) {
|
| + if (node === this) {
|
| + // |this| contains |e.target|, so nothing needs to be done. Allow
|
| + // focus to move from |this| to |e.target|.
|
| + return;
|
| + }
|
| + node = node.parentNode;
|
| + }
|
|
|
| + // |e.target| is outside of |this|, so focus |this|.
|
| tr.b.timeout(0).then(() => this.focus());
|
| e.preventDefault();
|
| e.stopPropagation();
|
|
|