Skip to content

Commit 1d577b1

Browse files
committed
feat(core): grid menus accessible
- 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'.
1 parent 1f1de5a commit 1d577b1

11 files changed

+303
-161
lines changed

misc/tutorial/102_sorting.ngdoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ columnDef option will cause sorting to be applied after the `cellFilters` are ap
238238
});
239239

240240
it('click one menu, then click another menu, expect undisplay and redisplay on second click', function() {
241-
grid1.expectVisibleColumnMenuItems( 0, 3 );
242-
grid1.expectVisibleColumnMenuItems( 1, 3 );
241+
grid1.expectVisibleColumnMenuItems( 0, 4 );
242+
grid1.expectVisibleColumnMenuItems( 1, 4 );
243243
});
244244

245245
it('toggle gender, expect Alexander Foley to move around', function() {

misc/tutorial/303_customizing_column_menu.ngdoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ See the example below for usage.
128128
})
129129
});
130130

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

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

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

188-
it('click header to sort third column, 7 visible items in the third column, implying remove sort option', function () {
188+
it('click header to sort third column, 8 visible items in the third column, implying remove sort option', function () {
189189
gridTestUtils.clickHeaderCell( 'grid1', 2 )
190190
.then(function () {
191-
gridTestUtils.expectVisibleColumnMenuItems( 'grid1', 2, 7 );
191+
gridTestUtils.expectVisibleColumnMenuItems( 'grid1', 2, 8 );
192192
});
193193
});
194194
});

misc/tutorial/401_AllFeatures.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ All features are enabled to get an idea of performance
112112
it('should not duplicate the menu options for pinning when resizing a column', function () {
113113
element( by.id('refreshButton') ).click();
114114
gridTestUtils.resizeHeaderCell( 'grid1', 1 );
115-
gridTestUtils.expectVisibleColumnMenuItems( 'grid1', 1, 11);
115+
gridTestUtils.expectVisibleColumnMenuItems( 'grid1', 1, 12);
116116
});
117117
});
118118
</file>

0 commit comments

Comments
 (0)