mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-21 20:01:52 +00:00
Fix keyboard appearance on Android. Closes #1070
This commit is contained in:
parent
f1aef7ed1a
commit
aa98c317b7
6 changed files with 20 additions and 5 deletions
7
dist/fabric.js
vendored
7
dist/fabric.js
vendored
|
|
@ -19762,7 +19762,6 @@ fabric.Image.filters.BaseFilter = fabric.util.createClass(/** @lends fabric.Imag
|
|||
|
||||
this.hiddenTextarea.value = this.text;
|
||||
this.hiddenTextarea.selectionStart = this.selectionStart;
|
||||
this.hiddenTextarea.focus();
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -20370,6 +20369,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
|
|||
initKeyHandlers: function() {
|
||||
fabric.util.addListener(fabric.document, 'keydown', this.onKeyDown.bind(this));
|
||||
fabric.util.addListener(fabric.document, 'keypress', this.onKeyPress.bind(this));
|
||||
fabric.util.addListener(fabric.document, 'click', this.onClick.bind(this));
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -20407,6 +20407,11 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
|
|||
88: 'cut'
|
||||
},
|
||||
|
||||
onClick: function() {
|
||||
// No need to trigger click event here, focus is enough to have the keyboard appear on Android
|
||||
this.hiddenTextarea.focus();
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles keyup event
|
||||
* @param {Event} e Event object
|
||||
|
|
|
|||
4
dist/fabric.min.js
vendored
4
dist/fabric.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/fabric.min.js.gz
vendored
BIN
dist/fabric.min.js.gz
vendored
Binary file not shown.
7
dist/fabric.require.js
vendored
7
dist/fabric.require.js
vendored
|
|
@ -19762,7 +19762,6 @@ fabric.Image.filters.BaseFilter = fabric.util.createClass(/** @lends fabric.Imag
|
|||
|
||||
this.hiddenTextarea.value = this.text;
|
||||
this.hiddenTextarea.selectionStart = this.selectionStart;
|
||||
this.hiddenTextarea.focus();
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -20370,6 +20369,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
|
|||
initKeyHandlers: function() {
|
||||
fabric.util.addListener(fabric.document, 'keydown', this.onKeyDown.bind(this));
|
||||
fabric.util.addListener(fabric.document, 'keypress', this.onKeyPress.bind(this));
|
||||
fabric.util.addListener(fabric.document, 'click', this.onClick.bind(this));
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -20407,6 +20407,11 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
|
|||
88: 'cut'
|
||||
},
|
||||
|
||||
onClick: function() {
|
||||
// No need to trigger click event here, focus is enough to have the keyboard appear on Android
|
||||
this.hiddenTextarea.focus();
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles keyup event
|
||||
* @param {Event} e Event object
|
||||
|
|
|
|||
|
|
@ -353,7 +353,6 @@
|
|||
|
||||
this.hiddenTextarea.value = this.text;
|
||||
this.hiddenTextarea.selectionStart = this.selectionStart;
|
||||
this.hiddenTextarea.focus();
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
|
|||
initKeyHandlers: function() {
|
||||
fabric.util.addListener(fabric.document, 'keydown', this.onKeyDown.bind(this));
|
||||
fabric.util.addListener(fabric.document, 'keypress', this.onKeyPress.bind(this));
|
||||
fabric.util.addListener(fabric.document, 'click', this.onClick.bind(this));
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -43,6 +44,11 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
|
|||
88: 'cut'
|
||||
},
|
||||
|
||||
onClick: function() {
|
||||
// No need to trigger click event here, focus is enough to have the keyboard appear on Android
|
||||
this.hiddenTextarea.focus();
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles keyup event
|
||||
* @param {Event} e Event object
|
||||
|
|
|
|||
Loading…
Reference in a new issue