diff --git a/CHANGELOG.md b/CHANGELOG.md index 260d15af1..eef1345c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ ### Bugfixes - リレー向けのActivityが一部実装で除外されてしまうことがあるのを修正 - 削除したノートやユーザーがリモートから参照されると復活することがあるのを修正 +- クライアント: ページ編集時のドロップダウンメニューなどが動作しない問題を修正 ## 12.94.1 (2021/10/25) diff --git a/src/client/components/form/select.vue b/src/client/components/form/select.vue index 9efaf0269..363b3515f 100644 --- a/src/client/components/form/select.vue +++ b/src/client/components/form/select.vue @@ -150,26 +150,26 @@ export default defineComponent({ }); }; - for (const optionOrOptgroup of options) { - if (optionOrOptgroup.type === 'optgroup') { - const optgroup = optionOrOptgroup; - menu.push({ - type: 'label', - text: optgroup.props.label, - }); - for (const option of optgroup.children) { + const scanOptions = (options: VNode[]) => { + for (const vnode of options) { + if (vnode.type === 'optgroup') { + const optgroup = vnode; + menu.push({ + type: 'label', + text: optgroup.props.label, + }); + scanOptions(optgroup.children); + } else if (Array.isArray(vnode.children)) { // 何故かフラグメントになってくることがある + const fragment = vnode; + scanOptions(fragment.children); + } else { + const option = vnode; pushOption(option); } - } else if (Array.isArray(optionOrOptgroup.children)) { // 何故かフラグメントになってくることがある - const fragment = optionOrOptgroup; - for (const option of fragment.children) { - pushOption(option); - } - } else { - const option = optionOrOptgroup; - pushOption(option); } - } + }; + + scanOptions(options); os.popupMenu(menu, container.value, { width: container.value.offsetWidth,