diff --git a/src/core/drive/page_snapshot.ts b/src/core/drive/page_snapshot.ts index 9db0743fb..8b0172e7b 100644 --- a/src/core/drive/page_snapshot.ts +++ b/src/core/drive/page_snapshot.ts @@ -30,9 +30,9 @@ export class PageSnapshot extends Snapshot { const clonedSelectElements = clonedElement.querySelectorAll("select") for (const [index, source] of selectElements.entries()) { - for (const [optionIndex, option] of Array.from(source.options).entries()) { - clonedSelectElements[index].options[optionIndex].selected = option.selected - } + const clone = clonedSelectElements[index] + for (const option of clone.selectedOptions) option.selected = false + for (const option of source.selectedOptions) clone.options[option.index].selected = true } for (const clonedPasswordInput of clonedElement.querySelectorAll('input[type="password"]')) {