From a7f596da7a8abbabf06cc27ca080d91e88688ef6 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 26 Apr 2024 10:59:51 +0200 Subject: [PATCH] FIX: relative picker was being reset on change (#26766) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A change in relative picker was causing a serie of events which ultimately would cause the whole list of time options to be reset and re-rendered which would cause a new instance of the picker to be created, causing a reset. The fix is using id in the each loop to help ember identify that it doesn’t have to re-render a specific component. --- .../app/components/time-shortcut-picker.hbs | 2 +- spec/system/bookmarks_spec.rb | 13 +++++++++++++ spec/system/page_objects/modals/bookmark.rb | 10 ++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/app/components/time-shortcut-picker.hbs b/app/assets/javascripts/discourse/app/components/time-shortcut-picker.hbs index c4ad735e694..4fcdd31f057 100644 --- a/app/assets/javascripts/discourse/app/components/time-shortcut-picker.hbs +++ b/app/assets/javascripts/discourse/app/components/time-shortcut-picker.hbs @@ -1,5 +1,5 @@ - {{#each this.options as |option|}} + {{#each this.options key="id" as |option|}} {{#unless option.hidden}}