Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EuiNavDrawer collapse/expand button height issue #2463

Merged
merged 3 commits into from
Oct 22, 2019

Conversation

andreadelrio
Copy link
Contributor

@andreadelrio andreadelrio commented Oct 21, 2019

Summary

I reverted some changes introduced in #2417 and ended up with the original situation (i.e. a collapse/expand button with a weird focus behaviour). However, I think I've found a way to fix this using the :focus-within selector.

This is the behaviour now:

newNawDrawer

Fixes #2456

Note: I moved footerContent back to its original position (above modifiedChildren) as I had missed a comment we have explaining why we need to have it before modifiedChildren.

Checklist

- [ ] Checked in dark mode
- [ ] Checked in mobile

  • Checked in IE11 and Firefox
    - [ ] Props have proper autodocs
    - [ ] Added documentation examples
    - [ ] Added or updated jest tests
    - [ ] Checked for breaking changes and labeled appropriately
    - [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@andreadelrio
Copy link
Contributor Author

@cchaos This is what was happening when adding a background to the button on focus . Here you can see the element with forced focus state on Chrome and in pink so that it's easy to see what was going on. With focus-within I added a background to its parent element. Is that too hacky?

prevFocus

@cchaos
Copy link
Contributor

cchaos commented Oct 22, 2019

The only problem with :focus-within is that it's not well supported by all browsers: https://caniuse.com/#feat=css-focus-within

@andreadelrio
Copy link
Contributor Author

Ok, I think I've found an alternative to using :focus-within. Tested in Chrome, Firefox and IE11.

@cchaos
Copy link
Contributor

cchaos commented Oct 22, 2019

Where is the reference to this comment?:

Note: I moved footerContent back to its original position (above modifiedChildren) as I had missed a comment we have explaining why we need to have it before modifiedChildren.

@andreadelrio
Copy link
Contributor Author

Where is the reference to this comment?:

Note: I moved footerContent back to its original position (above modifiedChildren) as I had missed a comment we have explaining why we need to have it before modifiedChildren.

I was refering to this https://github.com/elastic/eui/blob/v14.4.0/src/components/nav_drawer/nav_drawer.js#L332

{/* Put expand button first so it's first in tab order then on toggle starts the tabbing of the items from the top */}

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Ahh, right, ok I now follow through the comments on #2252.

LGTM! Only tested in Chrome. Can you just be sure to test in FF and IE before merging?

@andreadelrio
Copy link
Contributor Author

andreadelrio commented Oct 22, 2019

Ahh, right, ok I now follow through the comments on #2252.

LGTM! Only tested in Chrome. Can you just be sure to test in FF and IE before merging?

Just double checked on Firefox and IE11.

@andreadelrio andreadelrio merged commit 560152b into elastic:master Oct 22, 2019
@snide snide mentioned this pull request Oct 23, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EuiNavDrawer's expand button changes size on expand
2 participants