core: Prevent copying and cutting text from a password field

This commit is contained in:
Kamil Jarosz 2024-06-06 23:28:50 +02:00 committed by Nathan Adams
parent b50db4255c
commit 142fc1d232
1 changed files with 1 additions and 1 deletions

View File

@ -1444,7 +1444,7 @@ impl<'gc> EditText<'gc> {
| TextControlCode::SelectRightDocument
| TextControlCode::SelectAll => self.is_selectable(),
TextControlCode::Copy | TextControlCode::Cut => {
!selection.is_caret()
!self.is_password() && !selection.is_caret()
}
TextControlCode::Paste => context.ui.clipboard_available(),
_ => true,