Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Contrib > Lookup Component (Part 1) > Dropdown A11y Adjustments #1386

Merged
merged 41 commits into from
Jan 26, 2018

Conversation

Blackbaud-SteveBrush
Copy link
Member

@Blackbaud-SteveBrush Blackbaud-SteveBrush commented Dec 20, 2017

Adjustments, new features:

  • Dropdown Component, added keyboard interactions to navigate items with tab and arrow keys (addresses: User should be able to navigate dropdown menus with arrow keys #1352)
  • Dropdown Component: added message stream to allow remote control of dropdown (useful for consuming components)
  • Popover Component, added new skyPopoverAlignment input, to allow horizontal alignment of dropdowns ("left", "center", or "right").
  • Popover Component, popovers will now attempt to find an appropriate placement when the user scrolls or resizes the screen.

Components affected by change:

  • Color picker
  • Datepicker
  • List sort
  • List secondary actions
  • Tab dropdown
  • Time picker

Related pull request: #1220
Documentation pull request: blackbaud/skyux2-docs#19

@codecov-io
Copy link

codecov-io commented Dec 20, 2017

Codecov Report

Merging #1386 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #1386    +/-   ##
=======================================
  Coverage     100%    100%            
=======================================
  Files         370     370            
  Lines        6789    6942   +153     
  Branches      874     892    +18     
=======================================
+ Hits         6789    6942   +153
Impacted Files Coverage Δ
src/modules/colorpicker/colorpicker.component.ts 100% <100%> (ø) ⬆️
src/modules/datepicker/datepicker.component.ts 100% <100%> (ø) ⬆️
src/modules/popover/popover.component.ts 100% <100%> (ø) ⬆️
src/modules/sort/sort.component.ts 100% <100%> (ø) ⬆️
src/modules/popover/popover.module.ts 100% <100%> (ø) ⬆️
src/modules/dropdown/dropdown.module.ts 100% <100%> (ø) ⬆️
src/modules/timepicker/timepicker.component.ts 100% <100%> (ø) ⬆️
src/modules/dropdown/dropdown.component.ts 100% <100%> (ø) ⬆️
src/modules/popover/popover.directive.ts 100% <100%> (ø) ⬆️
...rc/modules/dropdown/types/dropdown-message-type.ts 100% <100%> (ø)
... and 5 more

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 6917f6a...ace2ccc. Read the comment docs.

@Blackbaud-SteveBrush Blackbaud-SteveBrush changed the title Contrib > Lookup Component (Part 1) > Dropdown A11y Adjustments [HOLD] Contrib > Lookup Component (Part 1) > Dropdown A11y Adjustments Jan 11, 2018
@@ -2,11 +2,5 @@
{
// Columns at which to show vertical rulers
"editor.rulers": [100],

// Controls after how many characters the editor will wrap to the next line. Setting this to 0 turns on viewport width wrapping (word wrapping). Setting this to -1 forces the editor to never wrap.
"editor.wordWrap": "wordWrapColumn",
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing some outdated settings, as well as the word wrap requirement.

@Blackbaud-SteveBrush Blackbaud-SteveBrush changed the title [HOLD] Contrib > Lookup Component (Part 1) > Dropdown A11y Adjustments Contrib > Lookup Component (Part 1) > Dropdown A11y Adjustments Jan 24, 2018
@Blackbaud-BobbyEarl
Copy link

Below are a couple things I quickly noticed while looking at the demo page based on the components you mentioned this PR affecting:

  • When the tabs revert to using the dropdown, I'm unable to get to the close button via the keyboard.

  • For the time picker, I'm unable to use the keyboard to navigate to the different times after the popover opens.

</sky-row>

<h3>
Showing a dropdown on mouse hover

Choose a reason for hiding this comment

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

Is there a SKY UX pattern for displaying a dropdown on mouseover? If not, we may not want to have this example because consumers may infer this is something that they should do in certain scenarios. If so, we should document why a consumer would want to show a dropdown on mouseover.


public openDropdown(event: MouseEvent) {
this.sendMessage(SkyDropdownMessageType.Open);
event.preventDefault();

Choose a reason for hiding this comment

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

It's best practice to not reference browser-specific events like MouseEvent in an Angular component (https://angular.io/guide/user-input#passing-event-is-a-dubious-practice). You can get the same behavior in the template by adding ; false after the click handler:

<button type="button" (click)="openDropdown(); false"></button>


public openDropdown(event: MouseEvent) {
this.sendMessage(SkyDropdownMessageType.Open);
event.preventDefault();

Choose a reason for hiding this comment

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

Referencing a browser event in an Angular component is not best practice (https://angular.io/guide/user-input#passing-event-is-a-dubious-practice). You should be able to achieve the same result by adding ; false to the end of the click handler in your template:

<button type="button" (click)="openDropdown(); false"></button>

</sky-row>

<h3>
Showing a dropdown on mouse hover

Choose a reason for hiding this comment

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

Is there a SKY UX pattern that shows a dropdown on hover? If not, we may want to remove this example because it may make the consumer wonder if this is something they should be doing. If so, we should document when this is appropriate behavior.

Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't something we want to promote. In general things should appear on click, anything that's done on hover would be an exception we'd want to evaluate on a case by case basis in a design review for that app/feature.


public ngOnInit() {
if (this.messageStream) {
this.messageStream

Choose a reason for hiding this comment

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

This is an interesting way of handling interactions with the dropdown. Should we also consider making this the only way the dropdown changes state? For instance, internal to the component we have calls to this.openDropdown(). Should we not push messages to the message stream instead? That would have the added benefit of the consumer handling events that happen internal to the component, such as when the dropdown is opened, closed, etc.

@Blackbaud-PaulCrowder
Copy link
Member

I'm approving this. @Blackbaud-BobbyEarl did you still have things you wanted addressed?

@Blackbaud-BobbyEarl
Copy link

Yes, I'd followed-up directly with @Blackbaud-SteveBrush, but I was still seeing strange behavior when adding more than 11 tabs, causing the dropdown to be used. Whether the dropdown was fullscreen or normal altered back and forth with each click. Were you able to duplicate that Steve?

@Blackbaud-SteveBrush
Copy link
Member Author

@Blackbaud-BobbyEarl Yes, I was able to replicate the behavior. I've made some changes to that effect. Do you mind running another check? Thank you!

Copy link

@Blackbaud-BobbyEarl Blackbaud-BobbyEarl left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @Blackbaud-SteveBrush!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants