Skip to content

fix(calendar-view): [calendar-view] increase the maximum height and overflow handling of calendar-view tooltip content to optimize display effect #3196

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

Merged
merged 2 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions packages/theme-saas/src/calendar-view/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,8 @@
@apply ~'max-w-[theme(spacing.80)]';

.tooltip-main{
@apply overflow-auto;
@apply max-h-[80vh];
@apply p-2;

.title{
Expand Down
5 changes: 5 additions & 0 deletions packages/theme/src/calendar-view/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -630,12 +630,17 @@
.inject-CalendarView-vars();
position: absolute;
max-width: 320px;

.tooltip-main {
overflow: auto;
max-height: 80vh;
padding: var(--tv-CalendarView-tooltip-title-font-size);

.title {
font-size: var(--tv-CalendarView-tooltip-title-font-size);
font-weight: var(--tv-CalendarView-tooltip-title-font-weight);
}

.date {
margin: 6px 0;
color: var(--tv-CalendarView-tooltip-date-text-color);
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/calendar-view/src/mobile-first.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
placement="right"
>
<template #content>
<div class="p-2">
<div class="p-2 max-h-[80vh] overflow-auto">
<div class="px-1.5 mb-1.5 border-l-2 border-color-brand">{{ state.eventTipContent.title }}</div>
<div class="mb-1.5 px-2 text-color-text-placeholder">
{{ state.eventTipContent.startDay }} {{ state.eventTipContent.startTime }} ~
Expand Down
8 changes: 7 additions & 1 deletion packages/vue/src/tooltip/src/mobile-first.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ export default defineComponent({
component: {
render: () => {
let content = getContent(this)
// 当内容为纯文本时,添加一层wrapper,其他情况(插槽、renderContent)原样输出
const addWrapper = typeof content === 'string'
let propsData = { on: { 'after-leave': this.doDestroy } }
let mouseenter = () => this.setExpectedState(true)
let mouseleave = () => {
Expand Down Expand Up @@ -163,7 +165,11 @@ export default defineComponent({
aria-hidden={this.disabled || !this.state.showPopper ? 'true' : 'false'}
onMouseenter={() => mouseenter()}
onMouseleave={() => mouseleave()}>
<div style={`overflow:auto; max-height:${this.contentMaxHeight}`}>{content}</div>
{addWrapper ? (
<div style={`overflow:auto;max-height:${this.contentMaxHeight}`}>{content}</div>
) : (
content
)}
{this.visibleArrow ? (
<div
x-arrow
Expand Down
Loading