Skip to content

Commit

Permalink
[Calendar] Restoring cursor for initial load (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
berhalak authored Sep 28, 2023
1 parent 6360d23 commit be785e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions calendar/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,12 @@ async function configureGristSettings() {
grist.ready({ requiredAccess: 'read table', columns: columnsMappingOptions, allowSelectBy: true });
}

// when a user selects a record in the table, we want to select it on the calendar
function gristSelectedRecordChanged(record, mappings) {
// When a user selects a record in the table, we want to select it on the calendar.
// This method must be run after updateCalendar method, so we need to wait for the same promise to resolve.
async function gristSelectedRecordChanged(record, mappings) {
const mappedRecord = grist.mapColumnNames(record, mappings);
if (mappedRecord && calendarHandler) {
await colTypesFetcher.getColTypes();
calendarHandler.selectRecord(mappedRecord);
}
}
Expand Down

0 comments on commit be785e7

Please sign in to comment.