スマホでも使えるWYSIWYGエディタQuillってことでつかってみのだが。。。
iphoneで「確定」する前の状態でバックスペースで削除した文字が、
次の動作(入力などのキーボード操作)をした瞬間に、削除前の文字列が復元されて入力される現象に遭遇。。。
とりあえず下記の用にソースを修正して回避した。
変更前
Keyboard.prototype._initListeners = function() {
return dom(this.quill.root).on('keydown', (function(_this) {
return function(event) {
var prevent;
prevent = false;
_.each(_this.hotkeys[event.which], function(hotkey) {
var metaKey;
metaKey = dom.isMac() ? event.metaKey : event.metaKey || event.ctrlKey;
if (!!hotkey.metaKey !== !!metaKey) {
return;
}
if (!!hotkey.shiftKey !== !!event.shiftKey) {
return;
}
if (!!hotkey.altKey !== !!event.altKey) {
return;
}
prevent = hotkey.callback(_this.quill.getSelection(), hotkey, event) === false || prevent;
return true;
});
return !prevent;
};
})(this));
};
変更後
Keyboard.prototype._initListeners = function() {
return dom(this.quill.root).on('keydown', (function(_this) {
return function(event) {
var prevent;
prevent = false;
_.each(_this.hotkeys[event.which], function(hotkey) {
var metaKey;
if (dom.isIOS() !== true) {
metaKey = dom.isMac() ? event.metaKey : event.metaKey || event.ctrlKey;
if (!!hotkey.metaKey !== !!metaKey) {
return;
}
if (!!hotkey.shiftKey !== !!event.shiftKey) {
return;
}
if (!!hotkey.altKey !== !!event.altKey) {
return;
}
prevent = hotkey.callback(_this.quill.getSelection(), hotkey, event) === false || prevent;
}
return true;
});
return !prevent;
};
})(this));
};