Not an answer but preventing paste would prevent users from using a password manager
s
Sebastian Kürten
04/16/2023, 9:27 AM
yeah, pasting should still be enabled, just copying and cutting out of the text field should get disabled
Sebastian Kürten
04/16/2023, 9:31 AM
Our current work in progress solution is this:
Copy code
LocalClipboardManager provides object : ClipboardManager {
override fun getText() = clipboardManager.getText() // allow pasting text from clipboard
override fun setText(annotatedString: AnnotatedString) = Unit // don't allow copying text into clipboard
}
it does more or less what we like to do, i.e. copying from the textfield is effectively impossible, however the UI still shows the Cut/Copy buttons when text is selected and right-clicked.