全日历选择在移动中未触发的回调

mi7gmzs6  于 2022-10-24  发布在  Angular
关注(0)|答案(3)|浏览(212)

我使用的是fullcalendar版本2.9.1。我将日历呈现为agendaWeek。当我点击桌面上的特定时间段时,它会触发SELECT回调,但当我点击移动设备时,它不会。有什么问题吗?

selectable:true,
     select: function(start, end, jsEvent, view) {
      // event is firing this callback
     }

我正在使用**ui.calendar**在Angular 应用程序中使用它

5anewei6

5anewei61#

我认为你需要点击并按住,才能在移动设备上选择日期/时段...https://fullcalendar.io/docs/event_ui/longPressDelay/

u91tlkcl

u91tlkcl2#

看来您需要设置点击时间。
longPressDelay: 1
示例

$('#calendar').fullCalendar
  height: 'auto'
  nowIndicator: true
  defaultView: gon.default_view
  header: ''
  selectable: true
  selectHelper: true
  longPressDelay: 1
  selectConstraint:
    start: '00:00'
    end: '24:00'
...
mlnl4t2r

mlnl4t2r3#

如果有人正在寻找同样的React,并在这篇文章中跌跌撞撞,就像发生在我身上的事情一样,你可以像下面的代码一样使用longPressDelay={1}属性进行操作。

<FullCalendar
        plugins={[dayGridPlugin, timeGridPlugin, interactionPlugin, listPlugin]}
        headerToolbar={{
          left: 'prev,next today',
          center: 'title',
          right: 'dayGridMonth,listWeek', // timeGridWeek,timeGridDay
        }}
        initialView="dayGridMonth"
        editable
        selectable
        selectMirror
        dayMaxEvents
        weekends
        initialEvents={testEvents}
        select={handleDateSelect}
        eventClick={handleEventClick}
        themeSystem="bootstrap5"
        longPressDelay={1} // This is the property you need to change
      />

相关问题