Using XF 220.127.116.11, 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 18.104.22.1686-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"