Fix entering text with compose key
Previously entering text in text inputs with the compose key would insert one or more NUL bytes before the inserted character.
This commit is contained in:
parent
e162c59160
commit
aaa2ba3ad4
1 changed files with 5 additions and 3 deletions
|
|
@ -1742,9 +1742,11 @@ where
|
|||
{
|
||||
let mut editor = Editor::new(unsecured_value, &mut state.cursor);
|
||||
|
||||
editor.insert(
|
||||
text.unwrap_or_default().chars().next().unwrap_or_default(),
|
||||
);
|
||||
let character =
|
||||
text.unwrap_or_default().chars().next().unwrap_or_default();
|
||||
if !character.is_control() {
|
||||
editor.insert(character);
|
||||
}
|
||||
let contents = editor.contents();
|
||||
let unsecured_value = Value::new(&contents);
|
||||
let message = (on_input)(contents);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue