Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(frontend): 子メニューの最大長調整が行われていない問題を修正 #14003

Merged
merged 18 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Fix: ショートカットキーが連打できる問題を修正
(Cherry-picked from https://github.com/taiyme/misskey/pull/234)
- Fix: MkSignin.vueのcredentialRequestからReactivityを削除(ProxyがPasskey認証処理に渡ることを避けるため)
- Fix: 子メニューの高さがウィンドウからはみ出ることがある問題を修正

### Server
- Feat: レートリミット制限に引っかかったときに`Retry-After`ヘッダーを返すように (#13949)
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkMenu.child.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only

<template>
<div ref="el" :class="$style.root">
<MkMenu :items="items" :align="align" :width="width" :asDrawer="false" @close="onChildClosed"/>
<MkMenu :items="items" :align="align" :width="width" maxHeight="calc(100dvh - 32px)" :asDrawer="false" @close="onChildClosed"/>
</div>
</template>

Expand Down
10 changes: 8 additions & 2 deletions packages/frontend/src/components/MkMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SPDX-License-Identifier: AGPL-3.0-only
}"
:style="{
width: (width && !asDrawer) ? `${width}px` : '',
maxHeight: maxHeight ? `${maxHeight}px` : '',
maxHeight: maxHeight ? `${maxHeight}px` : normalizedMaxHeight,
kakkokari-gtyih marked this conversation as resolved.
Show resolved Hide resolved
}"
@keydown.stop="() => {}"
@contextmenu.self.prevent="() => {}"
Expand Down Expand Up @@ -192,7 +192,7 @@ const props = defineProps<{
asDrawer?: boolean;
align?: 'center' | string;
width?: number;
maxHeight?: number;
maxHeight?: number | string;
}>();

const emit = defineEmits<{
Expand Down Expand Up @@ -225,6 +225,12 @@ const keymap = {

const childShowingItem = ref<MenuItem | null>();

const normalizedMaxHeight = computed(() => {
if (props.maxHeight == null) return undefined;
if (typeof props.maxHeight === 'number') return props.maxHeight + 'px';
return props.maxHeight;
});

let preferClick = isTouchUsing || props.asDrawer;

watch(() => props.items, () => {
Expand Down
Loading