New issue
Advanced search Search tips

Issue 806971 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: ----
Type: Bug


Previous locations:
gerrit:8240


Sign in to add a comment

Choose Tryjobs button should focus regex filter textbox

Project Member Reported by michae...@chromium.org, Jan 28 2018

Issue description

Affected Version: 2.15-rc2-2157-g1438975847

What steps will reproduce the problem?
1. Go to a CL
2. Click "Choose Tryjobs" button

Expected: The "Regex filter" textbox in the "Choose tryjobs" window is focused
Actual: No form element has keyboard focus. <Tab> focuses the textbox.
 

Comment 1 by logan@google.com, Jan 29 2018

Project: chromium
Moved issue gerrit:8240 to now be  issue chromium:806971 .

Comment 2 by logan@google.com, Jan 29 2018

Components: Infra>Codereview>Gerrit
Labels: -Priority-3

Comment 3 by aga...@chromium.org, Jan 31 2018

Owner: aga...@chromium.org
Status: Started (was: New)
Here's a basic CL: https://chromium-review.googlesource.com/c/infra/gerrit-plugins/buildbucket/+/894845

This partially helps. The input will be focused the first time you open the dialog after a pageload.

However, it doesn't become focused again if you close and reopen the dialog. The iron-overlay-behavior even has explicit support for that (https://github.com/PolymerElements/iron-overlay-behavior/blob/master/iron-overlay-behavior.html#L163) but something is going wrong.

If a simple solution becomes obvious, I'll do that, but otherwise we might have to file a bug upstream and leave this as-is.
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 31 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/gerrit-plugins/buildbucket/+/8b6bbfc8104e5015735e36c577b072bdfbb7326d

commit 8b6bbfc8104e5015735e36c577b072bdfbb7326d
Author: Aaron Gable <agable@chromium.org>
Date: Wed Jan 31 00:44:20 2018

Autofocus filter input when opening overlay

This is only a partial solution: although the input element
will be focused the first time the overlay is opened, it
doesn't become focused on future openings. This is despite
the fact that iron-overlay-behavior (which the parent element,
gr-overlay, imports) explicitly has support for focusing
any [autofocus] elements. It's not clear why that isn't
working as expected.

R=seanmccullough

Bug:  806971 
Change-Id: I572b4a491a8de7cd46b0a583417c6d43c4a2373a
Reviewed-on: https://chromium-review.googlesource.com/894845
Reviewed-by: Sean McCullough <seanmccullough@chromium.org>

[modify] https://crrev.com/8b6bbfc8104e5015735e36c577b072bdfbb7326d/src/main/resources/static/cr-tryjob-picker.html

Project Member

Comment 6 by bugdroid1@chromium.org, Jan 31 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/gerrit-plugins/buildbucket/+/0f63153fbfe0035f99e54c270f8fc109f4585b32

commit 0f63153fbfe0035f99e54c270f8fc109f4585b32
Author: Aaron Gable <agable@chromium.org>
Date: Wed Jan 31 23:36:54 2018

Better and forward-compatible autofocus

Even though iron-input-behavior (which gr-overlay imports) tries
to focus elements with the 'autofocus' attribute, it only does so
for element in the light dom. Because the filter input element is
part of cr-tryjob-picker's shadow dom, it doesn't get focused
by iron-input-behavior.

The solution is to have iron-input-behavior focus the only element
it can (the top-level cr-tryjob-picker itself), and then have that
focus trigger an on-focus handler, which then sets focus to the
place we want it.

This cannot be done in _handleChooseTryJobsOpen because doing so
results in a race between iron-input-behavior and us trying to set
focus.

Bug:  806971 
Change-Id: Id95e30b1517ddb7d6145e9a6498f8a4b68a54d15
Reviewed-on: https://chromium-review.googlesource.com/895845
Reviewed-by: Sean McCullough <seanmccullough@chromium.org>

[modify] https://crrev.com/0f63153fbfe0035f99e54c270f8fc109f4585b32/src/main/resources/static/cr-buildbucket-view.html
[modify] https://crrev.com/0f63153fbfe0035f99e54c270f8fc109f4585b32/src/main/resources/static/cr-buildbucket-view.js

Comment 7 by aga...@chromium.org, Jan 31 2018

Status: Fixed (was: Started)
The fix has been landed, but not imported and deployed. Going to mark this fixed; can Verify when deployment rolls out.

Sign in to add a comment