-
-
Notifications
You must be signed in to change notification settings - Fork 144
Open
Description
After upgrading a re-com/re-frame app from an old re-com version v2.21.0 to v2.28.2, scrollIntoView calls via reagent/after-render no longer work. Elements cannot be found in the DOM when the scroll effect runs.
On bisecting re-com versions, it turns out that v2.24.0 is the culprit.
Reproduction:
In an app using re-com components, trigger a scroll to an element after a state change:
(defn scroll-to-top
[elem]
(when elem
(.scrollIntoView elem (clj->js {:block "start"
:inline "nearest"}))))
(reg-fx
:set-scroll-position
(fn [panel-id]
(reagent/after-render
(fn []
(scroll-to-top (get-element-by-id panel-id))))))With v2.23.1: element is found and scrolled to.
With v2.24.0: element is not found in the DOM at the time after-render fires.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels