Allow pasting using Cmd+V in wxTextCtrl with wxTE_PASSWORD style

For some reason known only to Apple, NSSecureTextField allows pasting text
into it using its standard context menu, but not using the standard Cmd+V
keyboard shortcut. Moreover, apparently the control does something special to
disable it because pressing Cmd+V does result in a call to
-[NSSecureTextField control:textView:doCommandBySelector:], but with a dummy
"noop:" selector.

Detect this specific situation and check if we're called while handling Cmd+V
event and, if this is indeed the case, do paste the text into the control.

While it could be argued that this changes the platform behaviour, it seems
very hard, if not impossible, to imagine a situation in which this would be a
problem while not being able to easily paste into password fields is
definitely a real usability bug.
This commit is contained in:
Vadim Zeitlin
2016-11-20 23:35:01 +01:00
parent 92dc929b3f
commit fe685bc4c6
2 changed files with 20 additions and 0 deletions

View File

@@ -167,6 +167,7 @@ wxOSX:
and OSXDisableAllSmartSubstitutions() to control wxTextCtrl smart behavior.
- Don't allow interacting with disabled wxSlider (Andreas Falkenhahn).
- Fix setting alignment in wxTextCtrl with wxTE_DONTWRAP (Andreas Falkenhahn).
- Allow pasting using Cmd+V in wxTextCtrl with wxTE_PASSWORD style.
Unix: