Xamarin.forms: Entry's IsPassword property , when changed programmatically is not masking/unmasking text in the screen in Mac app

Created on 2 Apr 2018  ·  3Comments  ·  Source: xamarin/Xamarin.Forms

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

6 low impact macOS bug

All 3 comments

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

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

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

Was this page helpful?
0 / 5 - 0 ratings