作成日: 2025/05/19 最終更新日: 2026/06/30
文書種別
不具合
状況
修正済み
詳細
GcShortCut(ショートカットコンポーネント)でEnterキー押下時に次コントロールに移動するように設定して、ラジオボタンのグループにチェックされたアイテムがある場合には、該当するラジオボタンのみフォーカス移動するのが本来の動作ですが、未チェックのラジオボタンにもフォーカスが移動します。
回避方法
Service Pack 10(v10.0.4010.2012)で修正済み。
Service Pack を適用しない場合、JavaScriptでフォーカスを移動するラジオボタンを制御して回避が可能です。
<script>
const oldFunc = window.GCIM.HtmlElementHelper.GetElements;
window.GCIM.HtmlElementHelper.GetElements = () => {
const allElements = oldFunc();
return getCheckedOrFirst(allElements);
};
function getCheckedOrFirst(controls) {
const groupMap = new Map();
const result = [];
controls.forEach(ctrl => {
const el = ctrl.ElementObj;
if (el.type === 'radio' || el.type === 'checkbox') {
const groupName = el.name;
if (!groupMap.has(groupName)) {
groupMap.set(groupName, []);
}
groupMap.get(groupName).push(ctrl);
} else {
result.push(ctrl);
}
});
for (const group of groupMap.values()) {
const checked = group.find(ctrl => ctrl.ElementObj.checked);
if (checked) {
result.push(checked);
} else {
result.push(group[0]);
}
}
return result;
}
</script>