Skip to content
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

Fixed the hide password hint which is showing when the entry is focused #25768

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

devanathan-vaithiyanathan
Copy link
Contributor

@devanathan-vaithiyanathan devanathan-vaithiyanathan commented Nov 11, 2024

Root cause

  • Setting entry.IsPassword for a password field simply maps to setting textField.SecureTextEntry in the underlying macOS native control.
  • However, on macOS, setting SecureTextEntry alone triggers the system to display a password hint popup whenever the field gains focus. This behavior is native in macOS and isn’t explicitly managed or customized within MAUI.

Description of Change

  • To prevent the appearance of password hints in .NET MAUI on macOS and iOS, we set textField.TextContentType = UITextContentType.OneTimeCode.
  • This property avoids triggering password autofill suggestions or security prompts that are typically displayed when SecureTextEntry is enabled. By specifying OneTimeCode, we effectively restrict the macOS system from showing password hints.
    It prioritizes the detection of one-time codes, which can affect the display of password hints. This is because the system recognizes the field as intended for a one-time code rather than a password, and thus, it doesn’t show password suggestions.

Issues Fixed

Fixes #17105

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Output Screenshots

Before After
17105_macOS_BeforeChanges.mov
17105_macOs_AfterChanges.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Nov 11, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@devanathan-vaithiyanathan devanathan-vaithiyanathan marked this pull request as ready for review November 13, 2024 13:04
@devanathan-vaithiyanathan devanathan-vaithiyanathan requested a review from a team as a code owner November 13, 2024 13:04
Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

As @jsuarezruiz comment I don t think this is the best way to do, hiding the popup should be an opt in option via a platform specific option. We do want to get the password popup because thats what users expect on the Mac .

@sheiksyedm sheiksyedm added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 6, 2024
…sLayout is set for Tablet but not on mobile devices (dotnet#26152)"

This reverts commit 0ddc794.
…msLayout is set for Tablet but not on mobile devices (dotnet#26152)"

This reverts commit 4b9074c.
Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

@devanathan-vaithiyanathan as @rmarinho mentioned before, could you create a platform specific?

@devanathan-vaithiyanathan
Copy link
Contributor Author

@devanathan-vaithiyanathan as @rmarinho mentioned before, could you create a platform specific?

Moved the changes to be specific to the macOS platform, aligning the implementation with Catalyst-specific requirements. Also included test case for above fix.

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-entry Entry community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/iOS 🍎
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to hide the password hint which is showing when the entry is focused
6 participants