summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-10-31 19:35:35 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-10-31 19:35:35 +0900
commit540e6e4f99f0116303dd37ad88586f1426c31644 (patch)
tree24dce421852d0acaf86eafa8fb5f4dc9a0fd33ee /src
parentchore(client): Fix #7923 (diff)
downloadmisskey-540e6e4f99f0116303dd37ad88586f1426c31644.tar.gz
misskey-540e6e4f99f0116303dd37ad88586f1426c31644.tar.bz2
misskey-540e6e4f99f0116303dd37ad88586f1426c31644.zip
fix(client): ページ編集時のドロップダウンメニューなどが動作しない問題を修正
Diffstat (limited to 'src')
-rw-r--r--src/client/components/form/select.vue34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/client/components/form/select.vue b/src/client/components/form/select.vue
index 9efaf02697..363b3515fa 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,