-
-
Notifications
You must be signed in to change notification settings - Fork 667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fixed duplicate scroll button Issue in safari browser #3392
base: master
Are you sure you want to change the base?
fix: fixed duplicate scroll button Issue in safari browser #3392
Conversation
WalkthroughThe Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
✅ Deploy Preview for asyncapi-website ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-3392--asyncapi-website.netlify.app/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
components/buttons/ScrollButton.tsx (1)
30-35
: Consider these accessibility and UX improvements.While the fix works, we can enhance the implementation with:
- Accessibility improvements
- Smooth transitions
<button - className={`rounded-full bg-white shadow-md ${backToTopButton ? 'visible' : 'pointer-events-none invisible'}`} + className={`rounded-full bg-white shadow-md transition-opacity duration-200 ${ + backToTopButton ? 'visible opacity-100' : 'pointer-events-none invisible opacity-0' + }`} + aria-hidden={!backToTopButton} + aria-label="Scroll to top of page" onClick={scrollUp} > - <img src={scrollImage} alt='scroll to top' /> + <img src={scrollImage} alt="" role="presentation" /> </button>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
components/buttons/ScrollButton.tsx
(1 hunks)
🔇 Additional comments (2)
components/buttons/ScrollButton.tsx (2)
30-35
: LGTM! The visibility control fix should resolve the Safari issue.
The switch from conditional rendering to CSS-based visibility control is a good approach to prevent duplicate buttons from appearing during scroll events in Safari.
30-35
: Verify the fix across different Safari versions.
Let's ensure the solution works consistently across various Safari versions and scroll behaviors.
</button> | ||
)} | ||
<button | ||
className={`rounded-full bg-white shadow-md ${backToTopButton ? 'visible' : 'pointer-events-none invisible'}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of confused as how these changes are leading to fix the error in safari?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue was due to an empty true condition, which led to unexpected behavior, img copies in DOM, By updating this condition to execute a specific action when true, we effectively resolved the issue as highlighted by codeRabbit. The issue and solution videos illustrate this difference clearly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akshatnema ??
Description
ScrollButton.tsx
Screen.Recording.2024-11-13.at.9.30.59.PM.mov
Related issue(s)
Fixes #3197
Summary by CodeRabbit
ScrollButton
component for better visibility and interactivity as users scroll.