ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

GridMenu: "Column" items click will focus first item of menu list

Open ChrisWiGit opened this issue 10 years ago • 2 comments

Hi

Did anybody encounter the following issue with the grid menu on the latest version? On Chrome (latest version) the grid menu here (and in my apps) http://ui-grid.info/docs/#/tutorial/121_grid_menu behaves strange : If you click on a column visibility item (to show or hide a column), the first menu item gets the focus. If there are many columns and a vertical scrollbar is shown, the view is scrolled to the top of items.It is impossible to click multiple items without scrolling.

It does not happen in FF and IE in my tests.

Not sure, but this code in function itemAction is responsible: /* * XXX: Fix after column refactor * Ideally the focus would remain on the item. * However, since there are two menu items that have their 'show' property toggled instead. This is a quick fix. */ gridUtil.focus.bySelector(angular.element(gridUtil.closestElm($elm, ".ui-grid-menu-items")), 'button[type=button]', true);

It looks to me as if this code puts the focus on the first button item in the menu items list.

I suggest the following fix gridUtil.focus.byElement(angular.element($event.target)); target is supported by all browsers.

Unfortunately, I cannot provide a plunk since the compilated grid file is to large to be added as a file. (It returns bad gateway if doing so)

ChrisWiGit avatar Jul 01 '16 10:07 ChrisWiGit

Hi Chris, i think you are talking about this issue , https://github.com/angular-ui/ui-grid/issues/4623. if so there is a good plunk and you can show your solution also.

Wahap avatar Jul 01 '16 10:07 Wahap

Hi, thanks! A search did not come up with the bug. Moved my solution to it: https://github.com/angular-ui/ui-grid/issues/4623

ChrisWiGit avatar Jul 01 '16 10:07 ChrisWiGit