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

When pressing ctrl/cmd key on focus out of cell is throwing error #1221

Closed
Manikandan-K opened this issue Dec 13, 2013 · 3 comments
Closed
Labels
Milestone

Comments

@Manikandan-K
Copy link

When we press ctrl key when the focus is not in the handsontable it throws error 'cannot read property of undefined'.
When i debugged more in handson table source code i find out that it triggers setCopyableText() function. Because focus is not in the table, it is unable to find out selected text which throws error.

should we change setCopyableText to handle this case ?

This is reproducible even in the demo page: http://handsontable.com/demo/readonly.html

  1. Click on the readonly cell and click somewhere outside of the handsontable
  2. Keep the javascript console open
  3. Press the control key / cmd key to see the error
@su-docker
Copy link

Even I am seeing the same problem... I narrowed it down to this code block in editorManager.js file line:53

 if (Handsontable.helper.isCtrlKey(event.keyCode)) {
          //when CTRL is pressed, prepare selectable text in textarea
          //http://stackoverflow.com/questions/3902635/how-does-one-capture-a-macs-command-key-via-javascript
          that.setCopyableText();
          return;
 }

The problem is setCopyableText() method is always assuming a current cell selection which is not true in the above mentioned scenario and fails. If my understanding is right, I could patch this method to return if there is no current selection.

Please respond & TIA

@escobar5
Copy link

escobar5 commented Jan 9, 2014

I'm also having this problem, this also happens with Command Key (Mac) and Windows Key (Windows)

@warpech
Copy link
Member

warpech commented Jan 12, 2014

This is fixed now in 0.10.1. Could you please try again?

@warpech warpech closed this as completed Jan 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants