Skip to content

EPMRPP-117400 || Keep password field focus when toggling visibility#312

Merged
allaprischepa merged 1 commit into
developfrom
bugfix/EPMRPP-117400-keep-password-field-focus-when-toggling-visibility
Jul 14, 2026
Merged

EPMRPP-117400 || Keep password field focus when toggling visibility#312
allaprischepa merged 1 commit into
developfrom
bugfix/EPMRPP-117400-keep-password-field-focus-when-toggling-visibility

Conversation

@allaprischepa

@allaprischepa allaprischepa commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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

  • Bug Fixes
    • Improved the password visibility toggle behavior to prevent unintended form interactions when selecting or hiding the password.
    • Ensured the eye icon control responds consistently to user input.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The password visibility toggle now uses a parameterless state handler, while pointer-down default prevention is handled directly by the eye icon button.

Changes

Password visibility toggle

Layer / File(s) Summary
Refactor toggle event handling
src/components/fieldText/fieldText.tsx
Removes the event-typed handler parameter and preventDefault() call, updates the React imports, and adds pointer-down prevention to the password eye button.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: siarheirazuvalau

Poem

I’m a bunny with a button bright,
Toggling passwords day and night.
No event fuss, just state takes flight,
Pointer-down keeps the field just right.
Hop, hop—visibility feels light!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: preserving password field focus while toggling visibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/EPMRPP-117400-keep-password-field-focus-when-toggling-visibility

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/components/fieldText/fieldText.tsx (1)

219-219: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use onPointerDown instead of onMouseDown for consistency and better touch support.

The password visibility toggle was correctly updated to use onPointerDown to prevent focus stealing, which reliably handles mouse, pen, and touch interactions. Consider updating this clear button to use onPointerDown as 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

📥 Commits

Reviewing files that changed from the base of the PR and between 97ea69d and 921e2fa.

📒 Files selected for processing (1)
  • src/components/fieldText/fieldText.tsx

@allaprischepa
allaprischepa merged commit 996fa1e into develop Jul 14, 2026
2 checks passed
@allaprischepa
allaprischepa deleted the bugfix/EPMRPP-117400-keep-password-field-focus-when-toggling-visibility branch July 14, 2026 13:14
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.

2 participants