Skip to content

Commit

Permalink
Fix issue of not being able to scroll when dropdown opened
Browse files Browse the repository at this point in the history
  • Loading branch information
aidewoode committed Aug 26, 2022
1 parent 8e7d224 commit 12cb659
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
18 changes: 10 additions & 8 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@
<%= yield %>
</main>
<% else %>
<div class='o-flex u-vw-100 u-vh-100'>
<aside id='js-sidebar' class='o-flex__item o-flex__item--shrink-0 o-flex o-flex--column-reverse c-sidebar' data-turbo-permanent>
<div class='o-flex__item o-flex__item--shrink-0'>
<%= render 'shared/player' %>
</div>
<div class='o-flex__item o-flex__item--grow-1 u-h-0'>
<%= turbo_frame_tag 'turbo-playlist', src: current_playlist_songs_path(init: true), class: 'u-h-100 o-flex o-flex--column' %>
<div class='o-flex'>
<aside id='js-sidebar' class='o-flex__item o-flex__item--shrink-0 c-sidebar' data-turbo-permanent>
<div class='o-flex o-flex--column-reverse u-position-sticky-top u-overflow-auto u-vh-100'>
<div class='o-flex__item o-flex__item--shrink-0'>
<%= render 'shared/player' %>
</div>
<div class='o-flex__item o-flex__item--grow-1 u-h-0'>
<%= turbo_frame_tag 'turbo-playlist', src: current_playlist_songs_path(init: true), class: 'u-h-100 o-flex o-flex--column' %>
</div>
</div>
</aside>
<div class='o-flex__item o-flex__item--grow-1 u-overflow-auto' data-test-id='main_content'>
<div class='o-flex__item o-flex__item--grow-1' >
<div>
<header class='c-nav c-nav--primary u-position-sticky-top'>
<div id='turbo-flash' class='c-flash'>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
</head>

<body class="<%= 'u-overflow-hidden' unless turbo_native? %>">
<body>
<%= content_for?(:body) ? yield(:body) : yield %>
<%= render 'shared/icons' %>
</body>
Expand Down
2 changes: 1 addition & 1 deletion test/system/albums_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AlbumsSystemTest < ApplicationSystemTestCase

test "show next page albums when scroll to the bottom" do
visit albums_url
find(:test_id, "main_content").scroll_to :bottom
scroll_to :bottom

assert_selector(:test_id, "album_card", count: Pagy::DEFAULT[:items] * 2)
end
Expand Down
2 changes: 1 addition & 1 deletion test/system/artists_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ArtistsSystemTest < ApplicationSystemTestCase

test "show next page artists when scroll to the bottom" do
visit artists_url
find(:test_id, "main_content").scroll_to :bottom
scroll_to :bottom

assert_selector(:test_id, "artist_card", count: Pagy::DEFAULT[:items] * 2)
end
Expand Down
2 changes: 1 addition & 1 deletion test/system/songs_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class SongsSystemTest < ApplicationSystemTestCase

test "show next page songs when scroll to the bottom" do
visit songs_url
find(:test_id, "main_content").scroll_to :bottom
scroll_to :bottom

assert_selector(:test_id, "song_item", count: Pagy::DEFAULT[:items] * 2)
end
Expand Down

0 comments on commit 12cb659

Please sign in to comment.