-
Notifications
You must be signed in to change notification settings - Fork 90
fix(pfNotificationDrawer): Make expand and collapse links accessible #621
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(pfNotificationDrawer): Make expand and collapse links accessible #621
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understandable, looks good, functional and looks like we have the same pattern else where in the repo
We should probably take a look at why it causes the issue, seems almost like a hash attr and click but eh...
This should be a bug fix. |
<a ng-if="$ctrl.allowExpand" class="drawer-pf-toggle-expand fa fa-angle-double-left" ng-click="$ctrl.toggleExpandDrawer()"></a> | ||
<a ng-if="$ctrl.onClose" class="drawer-pf-close pficon pficon-close" ng-click="$ctrl.onClose()"></a> | ||
<a href="javascript:void(0);" ng-if="$ctrl.allowExpand" class="drawer-pf-toggle-expand fa fa-angle-double-left" ng-click="$ctrl.toggleExpandDrawer()"></a> | ||
<a href="javascript:void(0);" ng-if="$ctrl.onClose" class="drawer-pf-close pficon pficon-close" ng-click="$ctrl.onClose()"></a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to figure out the unit tests and use href="" or, worst case, use href="#0"
When using Component: pfTableView should not show the empty state when items is null FAILED When using Some of your tests did a full page reload! |
20fab00
to
785f50b
Compare
What?! NotificationDrawer change shouldn't have any affect on pfTableview. |
Maybe there is an error on my part. I will re-check. |
@dtaylor113 I commented out that specific unit test and the test passed when using |
@amarie401, I'l clone this PR and test |
@dtaylor113 thank you! |
Changing to href="#0" seems to work fine for me. |
@jeff-phillips-18 @dtaylor113 |
785f50b
to
8332bb7
Compare
I think the issue was in: https://github.com/patternfly/angular-patternfly/blob/master/test/notification/notification-drawer.spec.js#L423 |
So should we stick with href=#0? |
Yes, if that allows accessibility and doesn't break the unit tests |
@dtaylor113 I agree. Since we want the events to fire and to not use preventDefault then href=#0 would keep the reload from happening that breaks the unit test while also allowing accessibility. |
@jeff-phillips-18 thoughts? |
Not necessarily a fan of placing a hash into a link within an Angular app if there's routing involved, but as long as we're handling the click event properly seems ok... Edit: yeahhh I'm not super psyched about using the hash 0 in there |
Any work around @cdcabrera ? I would think that eventFire would need to be tweaked if that's what is causing the reload issue. |
I reinstalled/updated through NPM and ran back through the change and testing... Just running
From there I decided to start the local server, soooo ran
And finally, I quit the server and ran the tests again by themselves... they matched again
The only thing I could come up with is that possibly when running the tests beside the local serve, if we're using any kind of live reload mechanism that's running parallel to the unit tests and someone hasn't quit say multiple Chrome tabs... all running the project... there may be some funkiness around the testing. At this point I think it just comes down to consistency for us, or a pattern we want to stick with for the near term. Using the hash 0 works, and as long as we're handling the event properly shouldn't mess with any downstream app routing... If we're looking for extensions in accessibility it might be a good idea to take a peak at highlighting the rows while a user is tabbing through them (similar to hover state), but I'll leave that as a future UX/Design aspect So to answer your question @amarie401 for workarounds... eh, lets stick with your PR as is, as long as we all agree and stick to the pattern hopefully for the near term. (which coincidentally also makes search and replacing easy =) |
Agreed @cdcabrera (any thanks for looking into all the options). Recently this came up in Patternfly as well, and the decision was also to go with href="#0" so I think its best to be consistent here and with Patternfly. |
|
ID's starting with a number are invalid. so there cannot be an id="0" |
Nice. Thats clever. |
Description
Added
href
s to theng-click
s in header of the notification drawer to allow keyboard accessibility to the expand/collapse links. This would close #599