Hide pull-to-refresh when not pulling (#1986)

This commit is contained in:
soxa 2025-03-19 00:16:36 +01:00 committed by GitHub
parent 964cdc1d61
commit 63704a5f0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -72,7 +72,10 @@ export default function PullToRefresh ({ children, className }) {
onTouchMove={handleTouchMove}
onTouchEnd={handleTouchEnd}
>
<p className={`${styles.pullMessage}`} style={{ top: `${Math.max(-20, Math.min(-20 + pullDistance / 2, 5))}px` }}>
<p
className={`${styles.pullMessage}`}
style={{ opacity: pullDistance > 0 ? 1 : 0, top: `${Math.max(-20, Math.min(-20 + pullDistance / 2, 5))}px` }}
>
{pullMessage}
</p>
{children}