PWA TWebDBGrid + TWebIndexedDbClientDataset Issue

Hi, I'm working on a PWA app that uses TWebDBGrid, TWebIndexedDBClientDataset and TWebDataSource.

The TWebIndexedDBClientDataset has two indexes, and it's works fine at first - I can display and click on data in the grid to view selected row data. However when I switch indexes then the grid is updated and it looks okay, but when I click on a row it highlights the clicked row, but the dataset current row is set to the following row in the dataset. Off by one.
So basically the grid works, can view, scroll, click - but the click sets the current row to the row following the one I've clicked.

Here's my DB:

procedure TDM1.VisitDataDBInitialize;

VisitDataDB.FieldDefs.Add('id', ftInteger, 0, true);

VisitDataDB.FieldDefs.Add('visitid', ftInteger);
VisitDataDB.FieldDefs.Add('sheetid', ftInteger);
VisitDataDB.FieldDefs.Add('accountid', ftInteger);
VisitDataDB.FieldDefs.Add('userid', ftInteger);
VisitDataDB.FieldDefs.Add('supervisor', ftString);
VisitDataDB.FieldDefs.Add('sheetitemid', ftInteger);
VisitDataDB.FieldDefs.Add('contract', ftString);
VisitDataDB.FieldDefs.Add('productid', ftInteger);
VisitDataDB.FieldDefs.Add('product', ftString);
VisitDataDB.FieldDefs.Add('manufacturer', ftString);
VisitDataDB.FieldDefs.Add('instructions', ftString);
VisitDataDB.FieldDefs.Add('details', ftString);
VisitDataDB.FieldDefs.Add('prodinfo', ftString);
VisitDataDB.FieldDefs.Add('action_code', ftString);
VisitDataDB.FieldDefs.Add('department', ftString);
VisitDataDB.FieldDefs.Add('media', ftString);
VisitDataDB.FieldDefs.Add('week', ftString);
VisitDataDB.FieldDefs.Add('route_spec', ftString);
VisitDataDB.FieldDefs.Add('store_spec', ftString);
VisitDataDB.FieldDefs.Add('photo_required', ftString);
VisitDataDB.FieldDefs.Add('ordering', ftInteger);
VisitDataDB.FieldDefs.Add('question_order', ftInteger);
VisitDataDB.FieldDefs.Add('department_order', ftInteger);
VisitDataDB.FieldDefs.Add('code_data', ftString);
VisitDataDB.FieldDefs.Add('text_data', ftString);
VisitDataDB.FieldDefs.Add('photo_data', ftString);
VisitDataDB.FieldDefs.Add('entry_date', ftDateTime);
VisitDataDB.FieldDefs.Add('entry_location_lat', ftFloat);
VisitDataDB.FieldDefs.Add('entry_location_long', ftFloat);

VisitDataDB.AddIDBIndex('ByOrdering', 'ordering');
VisitDataDB.AddIDBIndex('ByDepartmentOrder', 'department_order');
VisitDataDB.IDBActiveIndex := 'ByOrdering';


And here's the code I'm using to switch indexes:

procedure TForm1.DepartmentsButtonClick(Sender: TObject);
VisitDataDBGrid.Enabled := False;
if DM1.VisitDataDB.IDBActiveIndex = 'ByOrdering' then
DM1.VisitDataDB.IDBActiveIndex := 'ByDepartmentOrder';
DepartmentsButton.Down := true;
VisitDataCaption.Caption := 'Visit ' + entry_store + ' Departments';
DM1.VisitDataDB.IDBActiveIndex := 'ByOrdering';
DepartmentsButton.Down := false;
VisitDataCaption.Caption := 'Visit ' + entry_store;

VisitDataDBGrid.Enabled := True;

You can see by the commented .First, .Refresh that I've been trying a few things to see if I can sort this out. But still the grid click hightlights the clicked row, and the DB current row is set to the following row.

What am I missing? Is it something to do with IDBActiveIndex?

FYI - this issue is fixed in the latest version of Web Core.
After switching indexes on a Indexed DB dataset the web DB grid now works properly.
The grid now responds by keeping track of the current record. And the grid + dataset + linked DB controls stay current.