Merge pull request #2632 from leo030303/fix_delete_key_bug

Fixed bug where delete key wasn't working in the text editor
This commit is contained in:
Héctor 2024-10-14 21:16:42 +02:00 committed by GitHub
commit c01ef5bdbb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1045,7 +1045,9 @@ impl<Message> Binding<Message> {
keyboard::Key::Named(key::Named::Backspace) => {
Some(Self::Backspace)
}
keyboard::Key::Named(key::Named::Delete) if text.is_none() => {
keyboard::Key::Named(key::Named::Delete)
if text.is_none() || text.as_deref() == Some("\u{7f}") =>
{
Some(Self::Delete)
}
keyboard::Key::Named(key::Named::Escape) => Some(Self::Unfocus),