From 15aad22c654fef375d9ae9368769ee96aa73b49d Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 29 Mar 2023 02:18:44 -0400 Subject: [PATCH] Fixes period dropdown not updating properly --- src/webviews/apps/plus/timeline/timeline.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/webviews/apps/plus/timeline/timeline.ts b/src/webviews/apps/plus/timeline/timeline.ts index ee4c909..808ab2d 100644 --- a/src/webviews/apps/plus/timeline/timeline.ts +++ b/src/webviews/apps/plus/timeline/timeline.ts @@ -172,10 +172,13 @@ export class TimelineApp extends App { const $periods = document.getElementById('periods') as HTMLSelectElement; if ($periods != null) { const period = this.state?.period; - for (let i = 0, len = $periods.options.length; i < len; ++i) { - if ($periods.options[i].value === period) { - $periods.selectedIndex = i; - break; + + const $periodOptions = $periods.getElementsByTagName('vscode-option'); + for (const $option of $periodOptions) { + if (period === $option.getAttribute('value')) { + $option.setAttribute('selected', ''); + } else { + $option.removeAttribute('selected'); } } }