Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Using XF 188.8.131.52, on UWP, an Entry with IsPassword = true does not allow selection of characters.
Typically a keyboard user might do Ctrl+A, Del to quickly delete contents of an Entry, or Ctrl+Home, Ctrl+Shift+End, Del for the same purpose.
Similarly, a mouse user might just swipe the mouse across with the left-button down to do the same thing.
Neither of these work when IsPassword = true.
Easily reproduced, using:
Entry userPasswordEntry = new Entry
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.StartAndExpand,
MinimumHeightRequest = 44,
MinimumWidthRequest = 44
userPasswordEntry.IsPassword = true;
This actually appears to be intended by design.
The comment in the code is as follows:
// This simulates the "do not allow clipboard copy" behavior the PasswordBox control has
Not allowing clipboard copy is different from not being able to select. The implementation may prevent clipboard copy but it inadvertently prevents select. It should not. Being able to select has use cases other than copying to clipboard.
John, I spent some time looking this because the assertion you made is correct although a little complicated. I have no guarantees this will be merged but there's a PR which I believe *mostly* fixes this issue:
The behavior as mentioned was presently allowing no selected text, and the current implementation is tricky because of the way that the FormsTextBox works, in that it has a backing Text property and stays synced with the base.Text property. Simply changing the FormsTextBox code so that the selection is allowed isn't an instant fix by itself, as doing something such as entering "123" into the entry, selecting all of it, and then pressing another character like "a" would result in the text being "1". No good. :)
Ultimately what you'll see in that PR is that the SelectionLength is being cached and OnKeyDown is being a bit abused to check against certain key shortcuts like Ctrl-C/X for copy/cut since the regular PasswordBox doesn't allow it. Now, the changes don't fix the fact that the context menu will still enable one to copy the text, but when that's used it only copies the characters as obfuscation characters (the ● character).
There are also a couple other existing issues that are noted there as well, so I mostly dealt with the matter at hand of selection. The context menu is an issue that might only be fixable on UWP because RT/8.1 doesn't appear to support the use of Clipboard, but I don't think it's the end of the world if it exists as-is for the time being.
Should be fixed on 2.3.5-pre1
Have verified the bug with latest forms build version 184.108.40.2066-pre6.
Issue is seems to be fixed with latest build as well.
Screen-cast : https://www.screencast.com/t/mxEg3ji9
Build Info: https://gist.github.com/GLjackyvaswani/600433ce6f3b92544b42d0392001d326
I've noticed a few bug reports where a comment starts "Have verified the bug". This wording suggests confirming the bug exists, not that it is fixed. Could you please use different wording on future bug reports (and ask those around you to do the same), either:
"Confirmed bug exists in version n.n.n.x"
"Tested. Bug appears fixed in version n.n.n.x"