【发布时间】:2020-08-20 13:20:41
【问题描述】:
我试图在用户点击日历中包含一些事件详细信息的事件时显示基本工具提示,但工具提示被下一行覆盖。
目前,我正在尝试使用 slotPropGetter 属性更改单元格的样式以包含 z-index: -1 并使用 z-index: 1000 对工具提示进行内联样式化,但无济于事。
这是我当前的组件:
export default() =>{
const eventStyleGetter = ({ color }) => {
const style = {
backgroundColor: color,
opacity: 0.8,
zindex: "6",
position:"relative",
};
return {
style: style,
};
};
const slotStyleGetter = () =>{
const style = {
position: "relative",
zindex:0,
height:"100px",
}
return{
style: style
}
}
const CalendarElement = (
<Calendar
localizer={localizer}
defaultDate={new Date()}
events={events}
style={{ height: 500 }}
eventPropGetter={(event) => eventStyleGetter(event)}
slotPropGetter={(slot) => slotStyleGetter(slot)}
onSelectSlot={(e) => handleSlotSelect(e)}
selectable
popup
components={{
event: EventPopover,
}}
/>
);
return(
{CalendarElement}
)
}
【问题讨论】:
标签: css reactjs react-big-calendar