Skip to content

Commit

Permalink
feat(core): grid menus accessible
Browse files Browse the repository at this point in the history
 - When the grid opens the focus is automatically set to the first element
in the list. When the menu closes the focus is automatically reutnred to
the menu button that opened that list except for when the column is
hidden. When the column is hidden the focus is set to the master grid
menu.
 - Also adds the ability to have screen reader only buttons in the menus.
The example of this is the 'close' menu item that only appears when the
focus is over it.
 - Updates e2e tests to reflect menu item addition.
 - The menu now has an additional item that is visible to screen readers
only and only becomes visible when focused. This adds one item to all of
the tests that are counting the number of elements that are 'displayed'.
  • Loading branch information
JLLeitschuh committed Jul 27, 2015
1 parent 1f1de5a commit 1d577b1
Show file tree
Hide file tree
Showing 11 changed files with 303 additions and 161 deletions.
4 changes: 2 additions & 2 deletions misc/tutorial/102_sorting.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ columnDef option will cause sorting to be applied after the `cellFilters` are ap
});

it('click one menu, then click another menu, expect undisplay and redisplay on second click', function() {
grid1.expectVisibleColumnMenuItems( 0, 3 );
grid1.expectVisibleColumnMenuItems( 1, 3 );
grid1.expectVisibleColumnMenuItems( 0, 4 );
grid1.expectVisibleColumnMenuItems( 1, 4 );
});

it('toggle gender, expect Alexander Foley to move around', function() {
Expand Down
12 changes: 6 additions & 6 deletions misc/tutorial/303_customizing_column_menu.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ See the example below for usage.
})
});

it('2 menu items in second column, implying no hide option and no remove sort option', function () {
gridTestUtils.expectVisibleColumnMenuItems( 'grid1', 1, 2 );
it('3 menu items in second column, implying no hide option and no remove sort option', function () {
gridTestUtils.expectVisibleColumnMenuItems( 'grid1', 1, 3 );
});

it('Long press opens menu in second column', function () {
Expand Down Expand Up @@ -181,14 +181,14 @@ See the example below for usage.
});
});

it('6 visible items in the third column, implying hide option', function () {
gridTestUtils.expectVisibleColumnMenuItems( 'grid1', 2, 6 );
it('7 visible items in the third column, implying hide option', function () {
gridTestUtils.expectVisibleColumnMenuItems( 'grid1', 2, 7 );
});

it('click header to sort third column, 7 visible items in the third column, implying remove sort option', function () {
it('click header to sort third column, 8 visible items in the third column, implying remove sort option', function () {
gridTestUtils.clickHeaderCell( 'grid1', 2 )
.then(function () {
gridTestUtils.expectVisibleColumnMenuItems( 'grid1', 2, 7 );
gridTestUtils.expectVisibleColumnMenuItems( 'grid1', 2, 8 );
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion misc/tutorial/401_AllFeatures.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ All features are enabled to get an idea of performance
it('should not duplicate the menu options for pinning when resizing a column', function () {
element( by.id('refreshButton') ).click();
gridTestUtils.resizeHeaderCell( 'grid1', 1 );
gridTestUtils.expectVisibleColumnMenuItems( 'grid1', 1, 11);
gridTestUtils.expectVisibleColumnMenuItems( 'grid1', 1, 12);
});
});
</file>
Expand Down
Loading

0 comments on commit 1d577b1

Please sign in to comment.