Skip to content

Commit dfe0c9f

Browse files
fix: copy cell keys to editor id map only if not null (#7857) (#7867)
Co-authored-by: Ugur Saglam <106508695+ugur-vaadin@users.noreply.github.com>
1 parent c8e37f1 commit dfe0c9f

File tree

1 file changed

+6
-6
lines changed
  • vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow/src/main/java/com/vaadin/flow/component/spreadsheet

1 file changed

+6
-6
lines changed

vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow/src/main/java/com/vaadin/flow/component/spreadsheet/Spreadsheet.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3775,12 +3775,11 @@ protected void loadCustomEditorOnSelectedCell() {
37753775
final short col = selectedCellReference.getCol();
37763776
final int row = selectedCellReference.getRow();
37773777
final String key = SpreadsheetUtil.toKey(col + 1, row + 1);
3778-
HashMap<String, String> cellKeysToEditorIdMap = new HashMap<>(
3779-
getCellKeysToEditorIdMap());
3780-
if (cellKeysToEditorIdMap != null
3781-
&& cellKeysToEditorIdMap.containsKey(key)
3778+
var currentCellKeysToEditorIdMap = getCellKeysToEditorIdMap();
3779+
if (currentCellKeysToEditorIdMap != null
3780+
&& currentCellKeysToEditorIdMap.containsKey(key)
37823781
&& customComponents != null) {
3783-
String componentId = cellKeysToEditorIdMap.get(key);
3782+
String componentId = currentCellKeysToEditorIdMap.get(key);
37843783
for (Component c : customComponents) {
37853784
if (getComponentNodeId(c).equals(componentId)) {
37863785
customComponentFactory.onCustomEditorDisplayed(
@@ -3790,7 +3789,8 @@ protected void loadCustomEditorOnSelectedCell() {
37903789
}
37913790
}
37923791
}
3793-
setCellKeysToEditorIdMap(cellKeysToEditorIdMap);
3792+
setCellKeysToEditorIdMap(currentCellKeysToEditorIdMap == null ? null
3793+
: new HashMap<>(currentCellKeysToEditorIdMap));
37943794
}
37953795
}
37963796

0 commit comments

Comments
 (0)