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

IText Broken on Android #2318

Closed
keeganmccallum opened this issue Jul 1, 2015 · 3 comments · Fixed by #2352
Closed

IText Broken on Android #2318

keeganmccallum opened this issue Jul 1, 2015 · 3 comments · Fixed by #2352
Labels

Comments

@keeganmccallum
Copy link

Due to this issue: https://code.google.com/p/android/issues/detail?id=42904#c15 text is uneditable for me on android in a cordova app. traced it to this part of the code:

  /**
   * Handles keyup event
   * @param {Event} e Event object
   */
  onKeyDown: function(e) {
    if (!this.isEditing) {
      return;
    }
    if (e.keyCode in this._keysMap) {
      this[this._keysMap[e.keyCode]](e);
    }
    else if ((e.keyCode in this._ctrlKeysMap) && (e.ctrlKey || e.metaKey)) {
      this[this._ctrlKeysMap[e.keyCode]](e);
    }
    else {
      // since keycode is always 0, we end up here every time. 
      return;
    }
    e.stopImmediatePropagation();
    e.preventDefault();
   this.canvas && this.canvas.renderAll();
  },

Not sure if anyone has any ideas, i've been manually setting the itext.text property equal to the value of the hiddenTextarea in this specific case, any other workarounds/bugfixes (which are a little cleaner) would be appreciated

@keeganmccallum keeganmccallum changed the title IText Broken in Webkit Views IText Broken on Android Jul 1, 2015
@somecodemonkey
Copy link
Contributor

@keeganmccallum I looked into this a while ago but i still think its the case that android chrome does not fire keypress event. This should probably be mapped to key up but i havent looked into itext in a while.

@keeganmccallum
Copy link
Author

I looked into that, and there is no keypress event, that is correct, but the larger issue is that the keycode does not get passed in any event including keyup and keydown, this is apparently a security decision by android....but makes life difficult in this case...

@asturur
Copy link
Member

asturur commented Jul 1, 2015

we will move on oninput event.
it already prooved to solve lot of issues.
we need time to do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants