Merge pull request #522 from EmbarkStudios/main

Fix text input deletion
This commit is contained in:
Jonathan Spira 2021-09-15 11:13:07 -04:00 committed by GitHub
commit 2ecd617218
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -288,8 +288,9 @@ where
}
};
// it should always end with this \0.
if self.buf.ends_with('\0') {
// it should always end with one (or more if characters were deleted)
// null terminators
while self.buf.ends_with('\0') {
self.buf.pop();
}
@ -386,8 +387,9 @@ impl<'ui, 'p, T: InputTextCallbackHandler, L: AsRef<str>> InputTextMultiline<'ui
)
};
// it should always end with this \0.
if self.buf.ends_with('\0') {
// it should always end with one (or more if characters were deleted)
// null terminators
while self.buf.ends_with('\0') {
self.buf.pop();
}