angular-ui/ui-grid

[proposal] Consistent API for event handling

Open

#3,767 建立於 2015年6月12日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)JavaScript (2,496 fork)batch import
help wantedtype: choretype: enhancement

倉庫指標

Star
 (5,395 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Consistent keyboard and mouse event handling

Capturing keyboard and mouse events within the grid can be challenging, largely because focus is often "faked". In order to effectively address #3695 (highlight cells and copy to the clipboard) keyboard events need to be captured within the grid, as well as mouse/touch "drag" and click/shift-click. The other area that would make sense to make more consistent is handling click, touch, hold, and drag events on column headers. These are a frequent cause for breakage in sorting, movecolumn and columnmenu.

Mouse/Touch actions

Click/touch

This can be a challenge when we need to delay detection to ensure that we aren't waiting for a hold/drag. See #3333.

Hold in place

Mostly used for touch devices, but may as well support mouse too.

Drag

On touch we need to have some "hold in place" time threshold to initiate the drag in order differentiate when the user is trying to scroll and when they are trying drag an object. Needs to block text selection.

Keyboard actions

Standard keyboard events, but we need to know if the user has focus within the grid. Especially if there are multiple grids on the page. There should also be a publicApi to expose keyboard events within the grid. For example maybe someone wants to capture ctrl-r to refresh the data in the grid.

貢獻者指南