Terra-core: Button outline styles inside of modal

Created on 15 May 2017  路  8Comments  路  Source: cerner/terra-core

Issue Description

Buttons inside the modal do not display an outline when active. However, when the modal is full screen, the buttons do display an outline when active.

Issue Type

  • [ ] New Feature
  • [ ] Enhancement
  • [x] Bug
  • [ ] Other

Expected Behavior

Buttons inside the modal display an outline when active.

Current Behavior

Buttons inside the modal do not display an outline when active. However, when the modal is full screen, the buttons do display an outline when active.

Steps to Reproduce

  1. Navigate to the modal examples using safari.
  2. Open the modal and tab through the focusable elements (you may need to turn on keyboard navigation for safari)

Safari: The tab key is being pressed but the button does not display as active
safari_no_focus

Chrome:
chrome_focus

Environment

  • Component Version: Button v0 and Modal v0
  • Browser Name and Version: Safari
  • Operating System and version (desktop or mobile): Mac OSX
terra-button bug

All 8 comments

@bjankord suggested we investigate adding outline styles instead of using the browsers default focus outline

As of right now, some sort of outline style will need to be applied to selectable list items when an item contains a chevron. Because of this I think it would be a good idea to set our own outline.

I lean towards using the browser's default styles for focus outlines, but in this case, it looks like there is an issue in Safari that is causing the focus outline not to render on the button element in this use case. This causes a usability / accessibility issue making it difficult to visually see which button is in focus within non-fullscreen modals.

I'd suggest we take a page from Bootstrap and remove the outline from <Button /> components on focus and provide our own focus outline.

I took a look. It seems the css styling bottom: auto is disabling the focus in Safari for modals of fixed size.

EDIT: This only seems to be an issue for the modal examples. The modal-manger examples with buttons appear to work as expected.

+1 @emilyrohrbough, what we need to adjust so we can remove bottom: auto

@neilpfeiffer and I have done some digging and have found a few things:

  • the first focusably element located at the bottom left corner will not receive focus styles but other elements will
  • adding padding: 10px to the inner content will allow the focus styles to apply

Tech Design

+1

Was this page helpful?
0 / 5 - 0 ratings