Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

fix(grid): move focus outline inside grid items #1195

Merged
merged 4 commits into from
Apr 10, 2019
Merged

Conversation

bmdalex
Copy link
Collaborator

@bmdalex bmdalex commented Apr 9, 2019

fix(grid): move focus outline inside grid items

Fixes #1035

Before:

Screenshot 2019-04-09 at 17 52 40

After:

Screenshot 2019-04-09 at 17 53 08

@codecov
Copy link

codecov bot commented Apr 9, 2019

Codecov Report

Merging #1195 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1195   +/-   ##
=======================================
  Coverage   82.47%   82.47%           
=======================================
  Files         740      740           
  Lines        8754     8754           
  Branches     1170     1236   +66     
=======================================
  Hits         7220     7220           
  Misses       1519     1519           
  Partials       15       15
Impacted Files Coverage Δ
...eact/src/themes/base/components/Grid/gridStyles.ts 13.33% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 783c783...dc0ce19. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 9, 2019

Codecov Report

Merging #1195 into master will decrease coverage by <.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1195      +/-   ##
==========================================
- Coverage   82.48%   82.47%   -0.01%     
==========================================
  Files         742      743       +1     
  Lines        8758     8761       +3     
  Branches     1236     1236              
==========================================
+ Hits         7224     7226       +2     
- Misses       1519     1520       +1     
  Partials       15       15
Impacted Files Coverage Δ
packages/react/src/themes/teams/componentStyles.ts 100% <100%> (ø) ⬆️
...act/src/themes/teams/components/Grid/gridStyles.ts 50% <50%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 621f08a...1189439. Read the comment docs.

@@ -24,6 +24,7 @@ const gridStyles: ComponentSlotStylesInput<GridProps, GridVariables> = {
gridGap,
display: 'grid',
justifyContent: 'space-evenly',
'& > *': { outlineOffset: '-3px' },
Copy link
Contributor

Choose a reason for hiding this comment

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

as we've discussed, I am suggesting to introduce this as part of the Teams theme, as this is about Teams scenarios that have introduced this issue. For other scenarios we would just introduce the same behavior (and visual appearance) as plain browser styles would provide, so I am suggesting to stick to that base browser's one in the base theme

Copy link
Collaborator Author

@bmdalex bmdalex Apr 10, 2019

Choose a reason for hiding this comment

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

oops...didn't notice it was moved to base; fixed, thanks, @kuzhelov

@@ -43,31 +43,21 @@ const renderImages = () => {

const renderImageButtons = () => {
return _.map(imageNames, imageName => (
<Button key={imageName} styles={imageButtonStyles}>
<Button key={imageName} text styles={imageButtonStyles}>
Copy link
Contributor

Choose a reason for hiding this comment

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

would suggest to remove this Button's prop, however I do understand why it was introduced. Still, we shouldn't fine tune the examples because of the particular theme experiencing styling problems - in contrast, we'd better to make them visible.

Imagine what this change would be for any theme other than Teams - the semantics of the markup is not consistent (why text) and, most probably, will cause presentation problems to other theme, as it will style text Button differently than Teams theme - maybe this text Button will have a look drastically different from the default one.

So, based on this reasoning, suggesting to remove this prop from the docs example

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed it. We still need to understand if the fact that the Button's border goes outside the element on keyboard focus is a styling problem. We need to understand if placing Button components next to each other is a valid scenario for layouting as shown in: https://codesandbox.io/s/w2xoqpy23l

If that's true, this is a styling issue that need to be addressed in Button style file

fyi @bcalvery

@bmdalex bmdalex merged commit d37c616 into master Apr 10, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/grid-focus-outline branch April 10, 2019 15:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessibility: Focus border is not rendered correctly on the grid component
2 participants