Fix auto-capitalization in the keyboard when the text box is empty. (#2483)

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Liam Hays 2023-03-15 08:51:15 -06:00 committed by GitHub
parent a69ae93871
commit c27d4d78f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -309,9 +309,9 @@ static void text_input_handle_ok(TextInput* text_input, TextInputModel* model, b
char selected = get_selected_char(model);
size_t text_length = strlen(model->text_buffer);
bool toogle_case = text_length == 0;
if(shift) toogle_case = !toogle_case;
if(toogle_case) {
bool toggle_case = text_length == 0 || model->clear_default_text;
if(shift) toggle_case = !toggle_case;
if(toggle_case) {
selected = char_to_uppercase(selected);
}