作成日: 2024/12/19 最終更新日: 2025/05/14
文書種別
不具合
発生環境
5.20241.9以降のバージョンで発生
状況
修正済み
詳細
headersVisibilityプロパティをColumnに設定した状態で、任意のセルを選択後、shiftとspaceキーを押下すると以下のスクリプトエラーが発生します。
wijmo.grid.min.js:14 Uncaught TypeError: Cannot read properties of undefined (reading 'querySelector')
at _KeyboardHandler._keydown (wijmo.grid.min.js:14:220976)
_KeyboardHandler._keydown @ wijmo.grid.min.js:14
回避方法
この問題はバージョン5.20251.34で修正されました。
修正版を適用しない場合の回避方法は次の通りです。
hostElement要素に以下のkeydownイベントを設定します。
theGrid.hostElement.addEventListener(
"keydown",
function (e) {
let sel = theGrid.selection;
if (e.key == " " && e.shiftKey && sel.isValid) {
e.preventDefault();
switch (theGrid.selectionMode) {
case wijmo.grid.SelectionMode.CellRange:
case wijmo.grid.SelectionMode.MultiRange:
case wijmo.grid.SelectionMode.Row:
case wijmo.grid.SelectionMode.RowRange:
case wijmo.grid.SelectionMode.ListBox:
theGrid.select(
new wijmo.grid.CellRange(sel.row, 0, sel.row, theGrid.columns.length - 1),
false
);
const rowHeaderIndex = sel.row - theGrid.rowHeaders.viewRange.row;
if(theGrid.headersVisibility !== wijmo.grid.HeadersVisibility.Column){
const selector = theGrid.rowHeaders.hostElement?.children[
rowHeaderIndex
]?.querySelector(".wj-column-selector");
if (selector && !theGrid.rows[sel.row].isSelected) selector.click();
}
break;
}
}
},
true
);