Skip to content

Commit

Permalink
fix(back-to-top): target surface with main role in demo JS
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjohnson committed Jan 16, 2025
1 parent 903b015 commit 20d51c0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion elements/rh-back-to-top/demo/color-context.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<script type="module">
/* add support for demo/fullscreen and dev server */
const b2t = document.querySelector('rh-back-to-top');
const main = document.querySelector('main');
const main = document.querySelector('main, [role="main"]');
// if main isn't scrollable use window
if (window.getComputedStyle(main).overflow === 'scroll') {
b2t.scrollableSelector = 'main';
Expand Down
2 changes: 1 addition & 1 deletion elements/rh-back-to-top/demo/no-slotted-text.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<script type="module">
/* add support for demo/fullscreen and dev server */
const b2t = document.querySelector('rh-back-to-top');
const main = document.querySelector('main');
const main = document.querySelector('main, [role="main"]');
// if main isn't scrollable use window
if (window.getComputedStyle(main).overflow === 'scroll') {
b2t.scrollableSelector = 'main';
Expand Down
2 changes: 1 addition & 1 deletion elements/rh-back-to-top/demo/on-a-scrollable-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<script type="module">
/* add support for demo/fullscreen and dev server */
const b2t = document.querySelector('rh-back-to-top');
const main = document.querySelector('main');
const main = document.querySelector('main, [role="main"]');
// if main isn't scrollable use window
if (window.getComputedStyle(main).overflow === 'scroll') {
b2t.scrollableSelector = 'main';
Expand Down
2 changes: 1 addition & 1 deletion elements/rh-back-to-top/demo/scroll-distance.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<script type="module">
/* add support for demo/fullscreen and dev server */
const b2t = document.querySelector('rh-back-to-top');
const main = document.querySelector('main');
const main = document.querySelector('main, [role="main"]');
// if main isn't scrollable use window
if (window.getComputedStyle(main).overflow === 'scroll') {
b2t.scrollableSelector = 'main';
Expand Down

0 comments on commit 20d51c0

Please sign in to comment.