fix: PlanningCalendar startDateChange not fired when clicking empty cell#4442
Open
EdrilanBerisha wants to merge 1 commit into
Open
Conversation
…ell outside current month
When the PlanningCalendar is in OneMonth view and the user clicks on an
empty interval cell that belongs to the next month (e.g. clicking on
March 2nd while viewing February), the calendar navigates to the next
month but the 'startDateChange' event was NOT fired.
Root cause:
In the 'handleIntervalSelect' function, when an interval in a row
timeline is clicked and the start date belongs to the next month, the
code called:
this.shiftToDate(oStartDate);
The 'shiftToDate' method only fires 'startDateChange' when its second
argument 'bOtherMonth' is truthy:
if (bOtherMonth) {
this.fireStartDateChange();
}
Since 'bOtherMonth' was not passed (undefined/falsy), 'startDateChange'
was never fired.
Fix:
Pass 'true' as the second argument to 'shiftToDate' so that
'startDateChange' is fired after navigation:
this.shiftToDate(oStartDate, true);
This is consistent with how '_handleCalendarSelect' already handles the
same scenario (line ~3355):
this.shiftToDate(oEvtSelectedStartCalendarDate.toLocalJSDate(), true);
Fixes: GitHub issue UI5#4413
Author
|
can you please review this PR please? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PlanningCalendar startDateChange not fired when clicking empty cell outside of current calendar.
When the PlanningCalendar is in OneMonth view and the user clicks on an empty interval cell that belongs to the next month (e.g. clicking on March 2nd while viewing February), the calendar navigates to the next month but the 'startDateChange' event was NOT fired.
Root cause:
In the 'handleIntervalSelect' function, when an interval in a row timeline is clicked and the start date belongs to the next month, the code called:
this.shiftToDate(oStartDate);
The 'shiftToDate' method only fires 'startDateChange' when its second argument 'bOtherMonth' is truthy:
if (bOtherMonth) {
this.fireStartDateChange();
}
Since 'bOtherMonth' was not passed (undefined/false), 'startDateChange' was never fired.
Fix:
Pass 'true' as the second argument to 'shiftToDate' so that 'startDateChange' is fired after navigation:
this.shiftToDate(oStartDate, true);
This is consistent with how '_handleCalendarSelect' already handles the same scenario (line ~3355):
this.shiftToDate(oEvtSelectedStartCalendarDate.toLocalJSDate(), true);
Fixes: GitHub issue #4413