Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

key navigation fix #131

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,22 @@ function createSharedEditor(column, originalRenderCell){
// remove the editor from the cell
parentNode.removeChild(node);

// remove the special css attribute for cell with editor
put(parentNode, '!dgrid-cell-inedit');

// pass new value to original renderCell implementation for this cell
Grid.appendIfNode(parentNode, originalRenderCell(
column.grid.row(parentNode).data, activeValue, parentNode));

// reset state now that editor is deactivated
activeCell = activeValue = null;
column._editorBlurHandle.pause();

// after editing is focus lost somewhere outside of the cell
// and its not possible to continue with navigation by keys
setTimeout(function(){
try{ parentNode.focus(); }catch(e){/** no exception here */}
},1);
}

function dismissOnKey(evt){
Expand Down Expand Up @@ -235,6 +244,8 @@ function showEditor(cmp, column, cell, value){
if(!isWidget){ updateInputValue(cmp, value); }

cell.innerHTML = "";
//special css attribute for cell with editor
put(cell, '.dgrid-cell-inedit');
put(cell, cmp.domNode || cmp);

if(isWidget){
Expand Down