telerik / kendo-react

Issue tracker - KendoReact http://www.telerik.com/kendo-react-ui/
https://kendo-react-teal.vercel.app
Other
212 stars 37 forks source link

[BUG][Scheduler] Resizing Behavior (making item smaller) issue on the first day in a view. #1959

Open pvBizzmine opened 7 months ago

pvBizzmine commented 7 months ago

Hello (:

I am encountering an inconvenience with the Kendo Scheduler component in React, particularly in the resizing functionality. The scheduler allows the creation and manipulation of items akin to a calendar, with the capability to resize these elements by clicking and dragging either the top or bottom.

However, a notable issue arises specifically on the first day of the calendar view. While attempting to resize an element by dragging downwards from the bottom, it expands as expected. Conversely, when trying to resize upwards by dragging from the bottom, the element only shortens by one time block. This limitation presents an annoyance in the user experience.

It's crucial to emphasize that this behavior is isolated to the first day within the view; on subsequent days, the resizing functionality behaves correctly.

This inconsistency in resizing behavior detracts from the overall usability of the component, necessitating a solution to ensure consistent and intuitive manipulation of elements across all days within the calendar view.

We use a custom slot in the scheduler:

  const CustomSlot = (props: SchedulerSlotProps) => {
    const customConditions: { backgroundColor: string; filter: string; color: string } = {
      backgroundColor: '',
      filter: '',
      color: '',
    };
    let { backgroundColor, color, filter } = customConditions;

    //Shows contrast between two different schedules
    if (props.group.index % 2) {
      backgroundColor = '#d4e4fc';
      if (!props.isWorkHour && !props.isAllDay) {
        filter = 'brightness(90%)';
      }
    }

    //Shows today coloured in month
    if (view === 'month' && mobileView !== 'day' && checkIfDateIsToday(props.end)) {
      const today = styleIfDateIsToday(props.end);
      backgroundColor = today.backgroundColor;
      color = today.color;
    }

    return (
      <SchedulerSlot
        {...props}
        onDoubleClick={onOpenSchedulerSlot}
        onClick={isMobileView ? onOpenSchedulerSlot : undefined}
        style={{ ...props.style, backgroundColor, color, filter }}
      />
    );
  };

props example:

Screenshot 2024-02-06 at 15 52 45

Package version:

Tested on:

Screenshot 2024-02-06 at 15 16 19 Screenshot 2024-02-06 at 15 17 51

zdravkov commented 7 months ago

Hey @pvBizzmine ,

Would you please send a sample Stackblitz or a CodeSandbox example where the issue can be replicated and observed so we could be more helpful with a possible solution?

Greetings, Plamen