Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Add focus ring to about page form elements #6037

Merged
merged 1 commit into from
Jan 11, 2017
Merged

Conversation

jkup
Copy link
Contributor

@jkup jkup commented Dec 6, 2016

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Fix #5971

Auditor @bsclifton, @cezaraugusto

@jkup jkup added design A design change, especially one which needs input from the design team. QA/test-plan-specified labels Dec 6, 2016
@jkup jkup added this to the 0.13.1 milestone Dec 6, 2016
@luixxiul
Copy link
Contributor

luixxiul commented Dec 6, 2016

Are these expected?

screenshot 2016-12-06 23 15 05 screenshot 2016-12-06 23 16 38

I implemented https://github.com/brave/browser-laptop/blame/master/less/button.less#L9 to avoid unexpected regressions like this: #5661

@bradleyrichter @jkup should

outline: none;
be fixed too?

@luixxiul
Copy link
Contributor

luixxiul commented Dec 6, 2016

Also is this expected on about:preferences#payments?

screenshot 2016-12-06 23 35 03

@bradleyrichter
Copy link
Contributor

oh no! This may have arrived with a chromium update?

We need to prevent this selection from ALL mouse input outside of the page content box.

@luixxiul
Copy link
Contributor

luixxiul commented Dec 6, 2016

If only elements on about pages should have the outline, I would add like this in preferences.less:

.prefBody {
  display: flex;
  height: 100%;
  margin-left: @sideBarWidth;

  button[class*="Button"],
  input,
  select {
    &:focus {
      outline: -webkit-focus-ring-color auto 5px;
    }
  }
}

@luixxiul
Copy link
Contributor

luixxiul commented Dec 6, 2016

@bradleyrichter I thought only button, input and select element should have the outline. Please correct me if I'm wrong.

Also the screenshots were taken after testing the commit by @jkup.

@bradleyrichter
Copy link
Contributor

To be more specific, this selection should only be shown when invoked for accessibility as an indicator for tabbing through elements when a mouse can not be physically used. If we can control this, it can be used in the toolbars as well. I just don't want it to appear outside of an accessibility mode.

@luixxiul
Copy link
Contributor

luixxiul commented Dec 6, 2016

I just don't want it to appear outside of an accessibility mode.

Can we detect it via JS?

@bradleyrichter
Copy link
Contributor

@luixxiul @jkup

Reviewing Chrome and Firefox shows that no browser toolbar items are tab-advance selectable except for the URL field which should have its own style and not use the item-select border.

Thus, "-webkit-focus-ring-color " should only apply to content area elements and never the toolbar elements.

@jkup
Copy link
Contributor Author

jkup commented Dec 8, 2016

We want not only prefs pages but also the bookmarks bar to show the outline like Chrome does. Also there is no way to use JS to detect accessibility mode. I'll update the selectors to be more specific.

@bsclifton
Copy link
Member

Sorry that I'm just now getting to this; the outline style looks great 😄

When I tried latest against our prefs page, it seems to only be highlighting:

  • URL bar
  • text fields
  • select fields
  • bookmarks toolbar (nice!! 😎)

I didn't see buttons get focus, even if I clicked them and then tried the tab ☹️

@jkup jkup force-pushed the add-focus-ring branch 2 times, most recently from 367b064 to cf0bdb6 Compare December 14, 2016 05:40
@jkup
Copy link
Contributor Author

jkup commented Dec 14, 2016

Fixed it for the navigation buttons like reload/back/forward but the links in preferences#payments should get a focus ring so users know they can interact with them.

What @luixxiul mentioned here is the correct behavior: #6037 (comment)

@jkup jkup requested a review from bsclifton December 14, 2016 19:41
@luixxiul luixxiul removed their assignment Dec 22, 2016
@jkup
Copy link
Contributor Author

jkup commented Dec 27, 2016

@bsclifton @luixxiul is this good to go?

@jkup
Copy link
Contributor Author

jkup commented Dec 27, 2016

Hey @cezaraugusto I know @bsclifton is super busy lately.. any chance you can give this a review for me and add the ready-to-merge label if it looks good? 🙏

@cezaraugusto cezaraugusto self-requested a review December 27, 2016 23:21
@cezaraugusto
Copy link
Contributor

++ Manually tested, LGTM

Not specifically related, but per @luixxiul comment here, it looks weird for me as well. Simple solution would be add display: flex (or block) to link inside .site. But it's ok as-is, just polish.

In the future, as we talk about accessibility, would love to see switch buttons tabbable as well.

@jkup
Copy link
Contributor Author

jkup commented Dec 28, 2016

@cezaraugusto thanks! I created #6439 to track that UI polish!

@bsclifton bsclifton assigned jkup and unassigned bsclifton Jan 9, 2017
@bsclifton bsclifton changed the base branch from master to 0.13.1-branch January 10, 2017 17:05
Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ran it manually; looking good 😄 Will run travis-ci tests and merge into 0.13.1-branch if passing

@bsclifton
Copy link
Member

Last travis-ci run showed several errors that I believe are not related; I re-ran each of those locally and they pass as expected 😄 Merging...

@bsclifton bsclifton merged commit d3759ba into 0.13.1-branch Jan 11, 2017
@bsclifton bsclifton deleted the add-focus-ring branch January 11, 2017 07:26
@bsclifton bsclifton removed this from the 0.13.1 milestone Jan 30, 2017
@bsclifton
Copy link
Member

Removed milestone after revert with 2aa39bb

@luixxiul
Copy link
Contributor

@bsclifton I'm not sure why this needed to be reverted. Will you please let me know?

@bsclifton
Copy link
Member

@luixxiul the focus ring negatively affected too many elements on the page. For example, see these:
#6760
#6761

Also, having the bookmarks toolbar items outlines is undesirable. cc: @bbondy

@bradleyrichter
Copy link
Contributor

There must be a way to contain this to the DOM/page region so it never effects the toolbar elements...

@luixxiul
Copy link
Contributor

#window > .mainContainer could be that way

@bsclifton
Copy link
Member

I think at this point, it would be better to go back to the issue and re-open if we think it's important. We can lay out requirements and set an appropriate milestone

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
design A design change, especially one which needs input from the design team. reverted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants