Skip to content

Commit

Permalink
Merge pull request #2632 from leo030303/fix_delete_key_bug
Browse files Browse the repository at this point in the history
Fixed bug where delete key wasn't working in the text editor
  • Loading branch information
hecrj authored Oct 14, 2024
2 parents 5d8fc92 + da13311 commit c01ef5b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion widget/src/text_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit c01ef5b

Please sign in to comment.