Jumping Grids - detail renderer has a grid in it

This is a bit peculiar. I have a grid that has detailsVisibleOnClick. The itemDetailRenderer for that grid returns a mini grid which has historical revisions of data for that particular row. The grid shows fine on clicking the row however the page focus jumps to the top of the page and leaves the grid area. Users have to scroll down to that details every time they click the grid.
This problem only happens with itemDetailRenderer as Grid. With a label it works as expected, but i need a Grid :slight_smile:

Below is the relevant code:

Grid<Record> newGrid = new Grid<>(); //outer (main) grid
			newGrid.setSelectionMode(SelectionMode.SINGLE);
			newGrid.setHeightByRows(true);
			newGrid.setColumnReorderingAllowed(true);
			com.vaadin.flow.component.grid.HeaderRow filterRow = newGrid.appendHeaderRow();
			AtomicReference<Column<Record>> highlightColumn = new AtomicReference<>();
	
			newGrid.addComponentColumn(getTextFieldValueProvider(1, false)).setHeader("Value").setKey("Value")
					.setResizable(true);
			if (standardNames.isEmpty()) {
				newGrid.addComponentColumn(getTextFieldValueProvider(2, false)).setHeader("Name").setKey("Name")
						.setResizable(true);
			} else {
				newGrid.addComponentColumn(new ComboBoxValueProvider(2, standardNames, false)).setHeader("Name")
						.setKey("Name").setResizable(true);
			}
			newGrid.addComponentColumn(new DatePickerValueProvider(4, false)).setHeader("RecordDate").setKey("RecordDate")
					.setResizable(true);
			newGrid.addComponentColumn(getTextFieldValueProvider(0, true)).setHeader("Error").setKey("Error")
					.setResizable(true);
			for(int hrc=0;hrc<historicalPeriods.size();hrc++) {
				String periodStr = historicalPeriods.get(hrc).toString();
				newGrid.addComponentColumn(getTextFieldValueProvider(8+hrc, true)).setHeader(periodStr).
				setKey(periodStr)
				.setResizable(true);
			}
			highlightColumn.set(newGrid.addComponentColumn(getTextFieldValueProvider(3, true)).setHeader("Text")
					.setKey("Text").setResizable(true));
	
			
			newGrid.setDetailsVisibleOnClick(true);
			
			newGrid.setItemDetailsRenderer(new ComponentRenderer<>(record -> {
				
				
				if (uuidRecordHistoryMap.containsKey(record.getField(5))) {
	
					Grid<Record> detailsGrid = new Grid<>();
	
					detailsGrid.setEnabled(false);
					detailsGrid.setHeightByRows(true);
					detailsGrid.setColumnReorderingAllowed(true);
					
					detailsGrid.addColumn(getStringValueProvider(1)).setHeader("Value").setKey("Value")
							.setResizable(true);
					detailsGrid.addColumn(getStringValueProvider(2)).setHeader("Name").setKey("Name")
							.setResizable(true);
	
					detailsGrid.addColumn(getStringValueProvider(4)).setHeader("RecordDate")
							.setKey("RecordDate").setResizable(true);
	
					detailsGrid.addColumn(getStringValueProvider(6)).setHeader("Timestamp")
							.setKey("Timestamp").setResizable(false).setWidth("2em");
	
					detailsGrid.addColumn(getStringValueProvider(7)).setHeader("User").setKey("User")
							.setResizable(false).setWidth("2em");
					detailsGrid.addColumn(getStringValueProvider(8)).setHeader("Error").setKey("Error")
							.setResizable(true);
					List<Record> items = new ArrayList<>();
					for(Record histRecord:uuidRecordHistoryMap.get(record.getField(5))) {
						boolean foundMatch =false;
						for(Record existing:items) {
							if(existing.equalsWithFields(histRecord)) {
								foundMatch = true;
								break;
							}
						}
						if(!foundMatch) {
							items.add(histRecord);
						}
					}

					items.sort((r1, r2) -> {
						return r2.getField(6).compareTo(r1.getField(6));
					});
					detailsGrid.setDataProvider(DataProvider.ofCollection(items));
					
					return detailsGrid;
				} else {
					return new Label(record.getField(2));
				}
				
			}));

Could be a bug? Hard to say based on your code example alone. If you can create a minimal reproducible example, you should file a GitHub issue at https://github.com/vaadin/vaadin-grid-flow/issues.