Skip to content

feat: always show Swap/Reset buttons and disable when inputs are empty#109

Merged
O2sa merged 1 commit intoO2sa:mainfrom
BhathiyaVicum:main
Apr 24, 2026
Merged

feat: always show Swap/Reset buttons and disable when inputs are empty#109
O2sa merged 1 commit intoO2sa:mainfrom
BhathiyaVicum:main

Conversation

@BhathiyaVicum
Copy link
Copy Markdown
Contributor

Fixes #108

Summary

This PR improves the UX of the CompareForm by ensuring that the Swap and Reset buttons are always visible, but properly disabled when there is no input data.

image

Changes

  • Always render Swap and Reset buttons (removed conditional rendering)
  • Add disabled state based on input values and loading state
  • Improve UX consistency between Submit, Swap, and Reset actions
  • Prevent actions when both input fields are empty or when loading

Logic Update

  • Buttons are disabled when:
    • Both username fields are empty
    • OR the form is in loading state

UX Improvement

  • Prevents layout shifting caused by conditional rendering
  • Improves discoverability of available actions
  • Keeps UI consistent and predictable

Checklist

  • Buttons always visible
  • Disabled state implemented correctly
  • No breaking changes

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

@BhathiyaVicum is attempting to deploy a commit to the osama's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown

Thank you for the pull request! ✅

A maintainer will review this soon. Please be patient while we take a look. 🙌

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dev-impact Ready Ready Preview, Comment Apr 24, 2026 6:02pm

@O2sa O2sa merged commit 472687e into O2sa:main Apr 24, 2026
2 checks passed
@O2sa
Copy link
Copy Markdown
Owner

O2sa commented Apr 24, 2026

Congratulations @BhathiyaVicum  🎊 Your first contribution has been merged! 🚀

Thank you for helping improve the project. If you find this tool useful, please consider giving us a ⭐ star on GitHub—it helps more developers find our work!

Repository owner deleted a comment from github-actions Bot Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ux: Always show form buttons but disable when empty

2 participants