Skip to content

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

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

Merged
merged 7 commits into from
Apr 22, 2025

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).

@PureWeen PureWeen changed the base branch from main to inflight/current April 22, 2025 22:26
@PureWeen PureWeen merged commit 5cc2c94 into dotnet:inflight/current Apr 22, 2025
108 checks passed
PureWeen pushed a commit that referenced this pull request Apr 23, 2025
…ed (#25768)

* Update TextFieldExtensions.cs

fix added

* Revert "Fixed CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but not on mobile devices (#26152)"

This reverts commit 0ddc794.

* Reapply "Fixed CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but not on mobile devices (#26152)"

This reverts commit 4b9074c.

* Moved fix to platform specific for macOS

* Updated Screenshot for mac

---------

Co-authored-by: Dhivya-SF4094 <[email protected]>
github-actions bot pushed a commit that referenced this pull request Apr 28, 2025
…ed (#25768)

* Update TextFieldExtensions.cs

fix added

* Revert "Fixed CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but not on mobile devices (#26152)"

This reverts commit 0ddc794.

* Reapply "Fixed CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but not on mobile devices (#26152)"

This reverts commit 4b9074c.

* Moved fix to platform specific for macOS

* Updated Screenshot for mac

---------

Co-authored-by: Dhivya-SF4094 <[email protected]>
anandhan-rajagopal pushed a commit to anandhan-rajagopal/maui that referenced this pull request May 2, 2025
…ed (dotnet#25768)

* Update TextFieldExtensions.cs

fix added

* Revert "Fixed CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but not on mobile devices (dotnet#26152)"

This reverts commit 0ddc794.

* Reapply "Fixed CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but not on mobile devices (dotnet#26152)"

This reverts commit 4b9074c.

* Moved fix to platform specific for macOS

* Updated Screenshot for mac

---------

Co-authored-by: Dhivya-SF4094 <[email protected]>
anandhan-rajagopal pushed a commit to anandhan-rajagopal/maui that referenced this pull request May 2, 2025
…ed (dotnet#25768)

* Update TextFieldExtensions.cs

fix added

* Revert "Fixed CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but not on mobile devices (dotnet#26152)"

This reverts commit 0ddc794.

* Reapply "Fixed CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but not on mobile devices (dotnet#26152)"

This reverts commit 4b9074c.

* Moved fix to platform specific for macOS

* Updated Screenshot for mac

---------

Co-authored-by: Dhivya-SF4094 <[email protected]>
PureWeen pushed a commit that referenced this pull request May 2, 2025
…ed (#25768)

* Update TextFieldExtensions.cs

fix added

* Revert "Fixed CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but not on mobile devices (#26152)"

This reverts commit 0ddc794.

* Reapply "Fixed CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but not on mobile devices (#26152)"

This reverts commit 4b9074c.

* Moved fix to platform specific for macOS

* Updated Screenshot for mac

---------

Co-authored-by: Dhivya-SF4094 <[email protected]>
SuthiYuvaraj pushed a commit to SuthiYuvaraj/maui that referenced this pull request May 9, 2025
…ed (dotnet#25768)

* Update TextFieldExtensions.cs

fix added

* Revert "Fixed CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but not on mobile devices (dotnet#26152)"

This reverts commit 0ddc794.

* Reapply "Fixed CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but not on mobile devices (dotnet#26152)"

This reverts commit 4b9074c.

* Moved fix to platform specific for macOS

* Updated Screenshot for mac

---------

Co-authored-by: Dhivya-SF4094 <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
7 participants