From c30e8f1fd92c96e50cd6f357e5815c9c070b3839 Mon Sep 17 00:00:00 2001 From: Justin Date: Wed, 20 Jul 2022 09:01:36 -0400 Subject: [PATCH 1/2] Set the ref on the actual carousel div --- app/soapbox/components/ui/hstack/hstack.tsx | 9 ++++++--- app/soapbox/features/feed-filtering/feed-carousel.tsx | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/soapbox/components/ui/hstack/hstack.tsx b/app/soapbox/components/ui/hstack/hstack.tsx index 2a021d903..f05f991ec 100644 --- a/app/soapbox/components/ui/hstack/hstack.tsx +++ b/app/soapbox/components/ui/hstack/hstack.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import React, { forwardRef } from 'react'; const justifyContentOptions = { between: 'justify-between', @@ -32,6 +32,8 @@ interface IHStack { alignItems?: 'top' | 'bottom' | 'center' | 'start', /** Extra class names on the
element. */ className?: string, + /** Children */ + children?: React.ReactNode, /** Horizontal alignment of children. */ justifyContent?: 'between' | 'center' | 'start' | 'end' | 'around', /** Size of the gap between elements. */ @@ -43,12 +45,13 @@ interface IHStack { } /** Horizontal row of child elements. */ -const HStack: React.FC = (props) => { +const HStack = forwardRef((props, ref) => { const { space, alignItems, grow, justifyContent, className, ...filteredProps } = props; return (
= (props) => { }, className)} /> ); -}; +}); export default HStack; diff --git a/app/soapbox/features/feed-filtering/feed-carousel.tsx b/app/soapbox/features/feed-filtering/feed-carousel.tsx index 8eebbda6d..5876bfd53 100644 --- a/app/soapbox/features/feed-filtering/feed-carousel.tsx +++ b/app/soapbox/features/feed-filtering/feed-carousel.tsx @@ -110,7 +110,7 @@ const FeedCarousel = () => { } return ( - +
{hasPrevPage && (
@@ -131,6 +131,7 @@ const FeedCarousel = () => { space={8} className='z-0 flex transition-all duration-200 ease-linear scroll' style={{ transform: `translateX(-${(currentPage - 1) * 100}%)` }} + ref={setCardRef} > {isLoading ? ( new Array(pageSize).fill(0).map((_, idx) => ( From 25b8835e6a78bf0ce2abd8b12e12c36e3f816ebb Mon Sep 17 00:00:00 2001 From: Justin Date: Wed, 20 Jul 2022 09:13:12 -0400 Subject: [PATCH 2/2] Fix backdrop-blur for Firefox --- app/soapbox/features/feed-filtering/feed-carousel.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/soapbox/features/feed-filtering/feed-carousel.tsx b/app/soapbox/features/feed-filtering/feed-carousel.tsx index 5876bfd53..477c17f01 100644 --- a/app/soapbox/features/feed-filtering/feed-carousel.tsx +++ b/app/soapbox/features/feed-filtering/feed-carousel.tsx @@ -118,7 +118,7 @@ const FeedCarousel = () => { @@ -155,7 +155,7 @@ const FeedCarousel = () => {