Fix TextFieldElement

This commit is contained in:
MrLetsplay 2023-10-16 17:31:12 +02:00
parent fabcf3cbef
commit b087ccad1e
Signed by: mr
SSH Key Fingerprint: SHA256:92jBH80vpXyaZHjaIl47pjRq+Yt7XGTArqQg1V7hSqg

View File

@ -263,6 +263,7 @@ UIElementType TextFieldElement::getType() {
void TextFieldElement::focusEnter() {
cursor->visible = true;
lastCharTyped = glfwGetTime();
capture = Input::captureKeyboardInput(
KeyCharCallback([](KeyCharEvent event, void *data) {
@ -337,8 +338,8 @@ void TextFieldElement::draw(UIPoint screenPos, glm::mat4 projection) {
}
void TextFieldElement::setText(std::string text) {
this->text = text;
this->textElement->setText(text);
this->cursorPos = 0;
updateText(Unicode::convertStdToU32(text));
}
}