Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Entry's IsPassword property , when changed programmatically is not masking/unmasking text in the screen in Mac app #2223

Closed
fazil1987 opened this issue Apr 2, 2018 · 3 comments · Fixed by #4175

Comments

@fazil1987
Copy link

fazil1987 commented Apr 2, 2018

Description

When IsPassword property of the entry is changed dynamically in Xamarin Forms, it's not getting reflected in the Xamarin Mac app integrated with Xamarin Forms.

Steps to Reproduce

  1. Create a entry named password in Xamarin Forms app
  2. Set the IsPassword property to true in Xaml.
  3. Create a button named toggle with the click handler toggle_clicked
  4. In the handler, change the password.IsPassword = false;
  5. Add some text in the entry
  6. Click the toggle button

Expected Behavior

text in the password entry should be unmasked

Actual Behavior

Text in the entry is still masked
Even the vice versa is not working as expected

Note : This happens only in Mac ( iOS, Android and UWP are good with this )

Basic Information

  • Version with issue: Xamarin Forms : 2.5.0.280555
  • Last known good version:
  • IDE: Visual studio for mac
  • Platform Target Frameworks:
    • iOS:
    • Android:
    • UWP:
    • Mac : 4.2.1.28
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices: Mac App

Screenshots

Reproduction Link

@pauldipietro pauldipietro added this to New in Triage Apr 2, 2018
@fazil1987 fazil1987 changed the title Entry's IsPassword property , when changed programmatically is not masking/unmasking text in the screen in Mac app out of Xamarin Forms Entry's IsPassword property , when changed programmatically is not masking/unmasking text in the screen in Mac app Apr 2, 2018
@joseluisct
Copy link

I'm experiencing same issue, it only happens on Mac. I've tested it with WPF and GTK and works OK.

@jassmith jassmith moved this from New to Ready For Work in Triage Apr 7, 2018
@wjk
Copy link

wjk commented May 7, 2018

This is because this code is not implemented. Unfortunately, implementing this on macOS is non-trivial, because on Mac, the "password on" control (NSSecureTextField) is a completely separate class from the "password off" control (NSTextField). Implementing this in EntryRenderer would require that it recreate its native control every time IsPassword changes.

Although NSSecureTextField supports removing the bullets (see -[NSSecureTextFieldCell echosBullets]), using that to implement "password off" is a bad idea, because setting echosBullets to false does not remove the other behaviors of NSSecureTextField (such as the inability to copy out of it).

@samhouts samhouts added this to To do in Other Ready For Work Oct 15, 2018
@samhouts samhouts removed this from Ready For Work in Triage Oct 15, 2018
AndreiMisiukevich added a commit to AndreiMisiukevich/Xamarin.Forms that referenced this issue Oct 21, 2018
AndreiMisiukevich added a commit to AndreiMisiukevich/Xamarin.Forms that referenced this issue Oct 21, 2018
AndreiMisiukevich added a commit to AndreiMisiukevich/Xamarin.Forms that referenced this issue Oct 22, 2018
@AndreiMisiukevich
Copy link
Contributor

@rmarinho I've just added implementation of this issue for MacOS.

@samhouts samhouts added this to In Progress in v3.6.0 Oct 22, 2018
Other Ready For Work automation moved this from To do to Done Oct 25, 2018
rmarinho pushed a commit that referenced this issue Oct 25, 2018
…#2223

* #2223 added possibility to change IsPassword for mac

* added test case
@samhouts samhouts moved this from In Progress to Done in v3.6.0 Oct 25, 2018
@samhouts samhouts removed this from Done in v3.6.0 Jan 3, 2019
@samhouts samhouts added this to In Progress in v3.5.0 Jan 11, 2019
@samhouts samhouts moved this from In Progress to Done in v3.5.0 Jan 11, 2019
@samhouts samhouts removed this from Done in Other Ready For Work May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
v3.5.0
  
Done
Development

Successfully merging a pull request may close this issue.

7 participants