EPMRPP-117400 || Keep password field focus when toggling visibility#312
Conversation
WalkthroughThe password visibility toggle now uses a parameterless state handler, while pointer-down default prevention is handled directly by the eye icon button. ChangesPassword visibility toggle
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: dependency version conflict. Check your lock file or package.json. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/fieldText/fieldText.tsx (1)
219-219: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse
onPointerDowninstead ofonMouseDownfor consistency and better touch support.The password visibility toggle was correctly updated to use
onPointerDownto prevent focus stealing, which reliably handles mouse, pen, and touch interactions. Consider updating this clear button to useonPointerDownas well. This ensures consistent behavior across the component and prevents mobile keyboards from being inadvertently dismissed during touch interactions.♻️ Proposed refactor
- onMouseDown={(e) => e.preventDefault()} + onPointerDown={(e) => e.preventDefault()}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/fieldText/fieldText.tsx` at line 219, Update the clear button handler in the field text component from onMouseDown to onPointerDown, preserving the existing preventDefault behavior so mouse, pen, and touch interactions do not steal focus or dismiss the keyboard.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/components/fieldText/fieldText.tsx`:
- Line 219: Update the clear button handler in the field text component from
onMouseDown to onPointerDown, preserving the existing preventDefault behavior so
mouse, pen, and touch interactions do not steal focus or dismiss the keyboard.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 44c5f9b5-039c-4e75-a9c3-17bc44d14657
📒 Files selected for processing (1)
src/components/fieldText/fieldText.tsx
Changes
Prevent the eye icon from stealing focus on pointer-down so the password field does not blur or trigger validation when toggling visibility.
Visuals
Before:
password-field--before.mp4
password-field--before-2.mp4
After:
password-field--after.mp4
password-field--after-2.mp4
Summary by CodeRabbit