mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
modify text entry behavior to recover default
if the field is empty and you're not in password mode, pressing left or right will populate the autocomplete field
This commit is contained in:
parent
64a2c2d6ff
commit
44b15c7262
1 changed files with 15 additions and 2 deletions
|
|
@ -368,7 +368,7 @@ impl ActionApi for TextEntry {
|
|||
log::trace!("key_action: {}", k);
|
||||
match k {
|
||||
'←' => {
|
||||
if self.visibility as u32 > 0 {
|
||||
if (self.visibility as u32 > 0) && self.is_password {
|
||||
match FromPrimitive::from_u32(self.visibility as u32 - 1) {
|
||||
Some(new_visibility) => {
|
||||
log::trace!("new visibility: {:?}", new_visibility);
|
||||
|
|
@ -378,10 +378,17 @@ impl ActionApi for TextEntry {
|
|||
panic!("internal error: an TextEntryVisibility did not resolve correctly");
|
||||
}
|
||||
}
|
||||
} else if !self.is_password {
|
||||
if payload.content.len() == 0 {
|
||||
if let Some(placeholder) = payload.placeholder {
|
||||
payload.content.append(placeholder.to_str()).ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'→' => {
|
||||
if (self.visibility as u32) < (TextEntryVisibility::Hidden as u32) {
|
||||
if ((self.visibility as u32) < (TextEntryVisibility::Hidden as u32))
|
||||
&& self.is_password {
|
||||
match FromPrimitive::from_u32(self.visibility as u32 + 1) {
|
||||
Some(new_visibility) => {
|
||||
log::trace!("new visibility: {:?}", new_visibility);
|
||||
|
|
@ -391,6 +398,12 @@ impl ActionApi for TextEntry {
|
|||
panic!("internal error: an TextEntryVisibility did not resolve correctly");
|
||||
}
|
||||
}
|
||||
} else if !self.is_password {
|
||||
if payload.content.len() == 0 {
|
||||
if let Some(placeholder) = payload.placeholder {
|
||||
payload.content.append(placeholder.to_str()).ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'∴' | '\u{d}' => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue