作成日: 2019/09/12 最終更新日: 2019/12/04
文書種別
不具合
発生環境
Internet Explorer 11
状況
修正済み
詳細
wijmo-wijgrid-filter-inputクラスを指定しグリッドのフィルタリング用エディタに対して"paste"イベントをハンドルしても、Internet Explorer 11環境でのCtrl+V押下で"paste"イベントが発生しません。
Internet Explorer 11のコンテキストメニューから「貼り付け」を選択した場合にはpasteイベントは発生します。
【サンプルコード】
$(".wijmo-wijgrid-filter-input").on("paste", function (e) {
console.log(".wijmo-wijgrid-filter-input paste")
})
Internet Explorer 11のコンテキストメニューから「貼り付け」を選択した場合にはpasteイベントは発生します。
【サンプルコード】
$(".wijmo-wijgrid-filter-input").on("paste", function (e) {
console.log(".wijmo-wijgrid-filter-input paste")
})
回避方法
この問題は2019J v3(4.5.20193.322)で修正されました。
※修正版を適用しない場合の回避方法は以下の通りです。
下記のようなコードにより回避できます。
<script>
$(function () {
// 回避策
$.fn.bindUp = function (type, fn) {
type = type.split(/¥s+/);
this.each(function () {
var len = type.length;
while (len--) {
$(this).bind(type[len], fn);
var evt = $._data(this, 'events')[type[len]];
evt.splice(0, 0, evt.pop());
}
});
};
function IsIE() {
var ua = window.navigator.userA
var msie = ua.indexOf('MSIE ');
if (msie > 0) {
return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
var trident = ua.indexOf('Trident/');
if (trident > 0) {
var rv = ua.indexOf('rv:');
return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
var edge = ua.indexOf('Edge/');
if (edge > 0) {
return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);
return false;
}
if (IsIE()) {
$(".wijmo-wijgrid-filter-input").bindUp("keydown", function (e) {
if (e.ctrlKey && e.which == 86) {
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
document.execCommand("paste");
}
});
}
$(".wijmo-wijgrid-filter-input").bindUp("paste", function (e) {
// ここでpasteイベントを処理します
console.log("paste");
});
})
</script>
※修正版を適用しない場合の回避方法は以下の通りです。
下記のようなコードにより回避できます。
<script>
$(function () {
// 回避策
$.fn.bindUp = function (type, fn) {
type = type.split(/¥s+/);
this.each(function () {
var len = type.length;
while (len--) {
$(this).bind(type[len], fn);
var evt = $._data(this, 'events')[type[len]];
evt.splice(0, 0, evt.pop());
}
});
};
function IsIE() {
var ua = window.navigator.userA
var msie = ua.indexOf('MSIE ');
if (msie > 0) {
return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
var trident = ua.indexOf('Trident/');
if (trident > 0) {
var rv = ua.indexOf('rv:');
return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
var edge = ua.indexOf('Edge/');
if (edge > 0) {
return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);
return false;
}
if (IsIE()) {
$(".wijmo-wijgrid-filter-input").bindUp("keydown", function (e) {
if (e.ctrlKey && e.which == 86) {
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
document.execCommand("paste");
}
});
}
$(".wijmo-wijgrid-filter-input").bindUp("paste", function (e) {
// ここでpasteイベントを処理します
console.log("paste");
});
})
</script>
旧文書番号
84482