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

Click on a read notification just leaves focus on the notification #2293

Closed
jwforres opened this issue Oct 17, 2017 · 14 comments
Closed

Click on a read notification just leaves focus on the notification #2293

jwforres opened this issue Oct 17, 2017 · 14 comments
Assignees
Labels
area/usability kind/bug Categorizes issue or PR as related to a bug. priority/P3
Milestone

Comments

@jwforres
Copy link
Member

Right now if you click on an already read notification it looks like this (see blue focus outlines):

screen shot 2017-10-17 at 4 51 59 pm

I question whether we should even still have a click handler on a read notification, clicking it does absolutely nothing.

@jwforres jwforres added area/usability kind/bug Categorizes issue or PR as related to a bug. priority/P3 labels Oct 17, 2017
@jwforres
Copy link
Member Author

@openshift/team-ux-review

@beanh66
Copy link
Member

beanh66 commented Oct 18, 2017

@jeff-phillips-18 I don't think we have this issue in PatternFly, but curious if you have seen it? Typically if a row is already marked as read, we would not see the blue outline. @jwforres I agree it is unnecessary.

@jwforres
Copy link
Member Author

Yeah @spadgett thought this was probably a bug in our special handling of click events in our impl of the drawer. Once its been marked as read I think we should remove the click handler and click target (no longer show the hand when hovering).

@spadgett
Copy link
Member

@benjaminapetersen
Copy link
Contributor

We can remove that handler pretty easily:

ng-click="notification.unread && $ctrl.customScope.markRead(notification)">

There is no longer a click, but that doesn't affect the styling. Working on a solution.

@benjaminapetersen
Copy link
Contributor

benjaminapetersen commented Oct 18, 2017

Looking @ this with @sg00dwin. So the patternfly demo appears to be tinkering with the focus. If I manually trigger the "focus" attrib in the web inspector, I can achieve the same effect:

Angular Patternfly:
screen shot 2017-10-18 at 11 50 05 am

Patternfly:
screen shot 2017-10-18 at 11 53 30 am

So there is something happening in the demo CSS that is not inherited in the actual component that is causing the focus to be hidden or clipped.

The property is outline: -webkit-focus-ring-color auto 5px;

@benjaminapetersen
Copy link
Contributor

benjaminapetersen commented Oct 18, 2017

The cause is our tabindex="0":

<div
  class="drawer-pf-notification-inner"
  tabindex="0"
  ng-click="notification.unread && $ctrl.customScope.markRead(notification)">

We did this to add the ability to tab through the notifications. The patternfly / angular-patternfly implementations do not do this. Visually it is a tad annoying, but what is the best solution regarding accessibility?

Default patternfly only has focus on the kebabs:

screen shot 2017-10-18 at 12 01 28 pm

@spadgett
Copy link
Member

I don't think what we have no is accessible anyway since there is no ng-keydown. The tabindex doesn't help. ng-click won't be triggered by the keyboard.

Better to have an sr-only button for accessibility and take tabindex off?

@benjaminapetersen
Copy link
Contributor

Thats true, the ng-click does not fire when pressing "enter".

I can do:

  <button
    class="sr-only"
    ng-click="notification.unread && $ctrl.customScope.markRead(notification)">
    Mark Read
  </button>

It eliminates the focus. Its a bit of a strange experience in that you can tab to this button, but since it is hidden you don't get any visual feedback.

@spadgett
Copy link
Member

Its a bit of a strange experience in that you can tab to this button, but since it is hidden you don't get any visual feedback.

Maybe add sr-only-focusable and make it a link?

https://getbootstrap.com/docs/3.3/css/#helper-classes-screen-readers

@benjaminapetersen
Copy link
Contributor

Ooo didn't know that one exists. Gave it a swing and I get this (even after the change to a link, just did the gif as a button):

2017-10-18 22 09 05

Tinkering with this some more, I'll [WIP] the PR for now.

@spadgett
Copy link
Member

Yeah we probably want to put it at the bottom of the notification content with good margins since it will be visible when focused.

openshift-merge-robot added a commit that referenced this issue Oct 20, 2017
…on-click-handler

Automatic merge from submit-queue.

Fix issue 2293: click on read notification focus bug

Fix issue #2293 

You can still click the notification to clear it, but now there is a `sr-only` button for tabbing.  The gif below shows the tabbing experience.  There is clearly a hidden element in the flow.

![2017-10-18 14 08 43](https://user-images.githubusercontent.com/280512/31734870-0e00b0b8-b40e-11e7-9989-29a3a06f58cc.gif)


@jwforres @spadgett
@jwforres jwforres added this to the 3.7.0 milestone Oct 23, 2017
@jwforres
Copy link
Member Author

We still have a bug here that the hover still makes it look clickable even after the notification is read, the cursor needs to change to a pointer.

@jwforres
Copy link
Member Author

jwforres commented Nov 1, 2017

The current behavior is what UXD is asking for, so closing. We can address any remaining concerns upstream in patternfly.

@jwforres jwforres closed this as completed Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/usability kind/bug Categorizes issue or PR as related to a bug. priority/P3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants