-
Notifications
You must be signed in to change notification settings - Fork 65
Add keyboard accessible dragondrop to tiles #1815
Add keyboard accessible dragondrop to tiles #1815
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1815 +/- ##
======================================
Coverage 100% 100%
======================================
Files 422 424 +2
Lines 8993 9056 +63
Branches 1332 1355 +23
======================================
+ Hits 8993 9056 +63
Continue to review full report at Codecov.
|
…ssible-dragondrop-to-tiles
…ssible-dragondrop-to-tiles
@blackbaud-conorwright this is looking good. Couple questions:
|
Hey @Blackbaud-AlexKingman |
…com:blackbaud/skyux2 into add-keyboard-accessible-dragondrop-to-tiles
@blackbaud-conorwright your click-target changes look good! Any news back from Matt re: label clarification? |
Not yet, I think he might be rather busy this week. I may ping him again later today if I don't hear back. |
@blackbaud-conorwright I may have found a nice pattern that will improve the accessibility here. Check out "Pattern #1: Sorting a List" from this article. tl;dr
When tabbing in to the first list-item, it will read,
What do you think of this @Blackbaud-MattGregg ? |
I think that pattern looks promising. Looks great with use of Live region and feedback on where item is positioned after changes. |
if (this.config && this.config.layout.multiColumn) { | ||
for (let column of this.config.layout.multiColumn) { | ||
/*istanbul ignore else */ | ||
if (column.tiles) { |
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.
Just curious - would this be more clear with a .find()
instead of a for()
loop? I don't have a good answer, just curious about your thoughts.
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.
Oh nice, yeah that would be more efficient 😄
swapped
@@ -159,6 +145,100 @@ export class SkyTileDashboardService { | |||
} | |||
} | |||
|
|||
public moveTile(tileCmp: SkyTileComponent, direction: string, tileDescription: string) { |
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.
Since this is only utilized via keyboard commands, should we make the method name more specific? Something like moveTileOnKeyDown
?
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.
Yeah, that would be a better name. Changing
} | ||
|
||
// Move the tile element in the document | ||
let tileComponentInstance = this.getTileComponent(tileId); |
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.
Maybe being paranoid here, but should we do a null check on tileComponentInstance
? Is there a chance of that ever being null?
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.
Added a check :)
It seems very unlikely since I pass in the component instance but this tie in could be bumped eventually with mismatch between the document and our internal map of the tiles
column.tiles = column.tiles.filter(item => item !== tile); | ||
this.moveTilesToColumn(this.columns.toArray()[colIndex + operator], [tile]); | ||
|
||
// Report the change in configuration |
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.
I see this report feature a couple times in here. Should we encapsulate it to its own method?
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.
I don't think it's really worth it here. All I'm doing is constructing the object and the difference between these two calls are nearly all of the logic.
I like the changes. Much cleaner! Great job. 🚢 🇮🇹! |
Resolves: #1371 and #1372