diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index da217b874..5158c724d 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -26,3 +26,4 @@ @import "autocomplete_overrides"; @import "jquery-ui/sortable"; @import "leaflet"; +@import "sticky_overrides"; diff --git a/app/assets/stylesheets/sticky_overrides.scss b/app/assets/stylesheets/sticky_overrides.scss new file mode 100644 index 000000000..f00d7417e --- /dev/null +++ b/app/assets/stylesheets/sticky_overrides.scss @@ -0,0 +1,9 @@ +// Overrides styles of foundation-sticky + +// Patch authored by shashabeep +// Check https://github.com/foundation/foundation-sites/issues/11098#issuecomment-528363771 +.proposal-show { + .sticky.is-anchored { + top: 0 !important; + } +} diff --git a/spec/system/proposals_spec.rb b/spec/system/proposals_spec.rb index cd84e2c5b..cb67e8ee3 100644 --- a/spec/system/proposals_spec.rb +++ b/spec/system/proposals_spec.rb @@ -212,6 +212,19 @@ describe "Proposals" do end end + describe "Sticky support button on medium and up screens", :js do + scenario "is shown anchored to top" do + proposal = create(:proposal) + visit proposals_path + + click_link proposal.title + + within("#proposal_sticky") do + expect(find(".is-anchored")).to match_style(top: "0px") + end + end + end + describe "Show sticky support button on mobile screens", :js do let!(:window_size) { Capybara.current_window.size }