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(DropdownMenu): fixed the upward expansion style error in some models #1603

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all 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
13 changes: 4 additions & 9 deletions src/dropdown-menu/dropdown-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,10 @@ export default defineComponent({
return {
zIndex: menuProps.zIndex && menuProps.zIndex + 1,
position: 'absolute',
overflow: 'hidden',
};
});
const styleContent = computed(() => {
return [`${dropdownItemClass.value}__content`, `t-popup__content`];
});
const contentStyle = computed(() => {
return menuProps.direction === 'up' ? { transform: 'rotateX(180deg) rotateY(180deg)' } : {};
});

const popupId = getUniqueID();
// 设置展开/收起状态
const setExpand = (val: boolean) => {
Expand All @@ -94,7 +90,6 @@ export default defineComponent({

menuProps.direction === 'up'
? (state.expandStyle = {
transform: menuProps.direction === 'up' ? 'rotateX(180deg) rotateY(180deg)' : '',
zIndex: menuProps.zIndex,
bottom: `${winHeight - top}px`,
})
Expand Down Expand Up @@ -293,15 +288,15 @@ export default defineComponent({
<div id={popupId} class={classes.value} style={{ ...expandStyle.value }}>
<t-popup
visible={isShowItems.value}
placement={menuProps.direction === 'up' ? 'bottom' : 'top'}
duration={duration.value}
showOverlay={showOverlay.value}
style={popupStyle.value}
overlayProps={{ style: 'position: absolute' }}
class={`${dropdownItemClass.value}__popup-host`}
attach={`#${popupId}`}
onVisibleChange={onVisibleChange}
>
<div ref={popupContent} class={styleContent.value} style={contentStyle.value}>
<div ref={popupContent} class={`${dropdownItemClass.value}__content`}>
<div class={`${dropdownItemClass.value}__body`}>{content || defaultSlot()}</div>
{footer || footerSlot()}
</div>
Expand Down
Loading