Skip to content

Commit

Permalink
Fix disabled scroll bug with Schedule Finder
Browse files Browse the repository at this point in the history
This fixes an issue where clicking a link from the Schedule Finder modal
(e.g. one of the stops in the schedule) would result in the destination
page, and possibly later visited pages, being un-scrollable until a full
page reload was performed.

This was caused by the modal setting a `modal-open` class on the `html`
element, which then persisted during Turbolinks navigation, which only
replaces the `body`. It appears we intended to disable Turbolinks on the
pages that open the modal, but the logic was wrong and would keep it
enabled if it had ever been enabled on a previous page (without any full
page reloads in between).
  • Loading branch information
digitalcora committed Nov 26, 2019
1 parent c4fac9e commit b050863
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/site/lib/site/body_tag.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ defmodule Site.BodyTag do
end

defp enable_turbolinks?(conn) do
is_nil(conn.assigns[:disable_turbolinks]) or Turbolinks.enabled?(conn)
is_nil(conn.assigns[:disable_turbolinks])
end

defp javascript_class(conn) do
Expand Down

0 comments on commit b050863

Please sign in to comment.