mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-01 05:10:41 +00:00
click on Inputtext no refreshing text #5054
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#5054
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version/Branch of Dear ImGui:
Version: 1.73
Branch: XXX (master/viewport/docking/etc.)
OpenGL/ Visual studio 2019/
Back-ends: Custom engine
Operating System: Windows 10
I have a modal window that contains an input text field. Using the keyboard events from my custom engine, I update a char array that I linked to the the input text field. However, when I click on the input field (I guess to do focus on it), the input text field doesnt refresh from the data in my char array. If I click outside the input field (lose focus), the input refresh with the char array (check the gif below).
Any thoughts why this could be happening?
Screenshots/Video
Use static size for writable
I suppose that
m_copy_nameis astd::string?In which case, you can include imgui_stdlib and directly use your std::string:
I tried both suggested approaches, none of them worked :(
writabledid not change the behavior.In this case, the inputtext only refresh if there's no focus on the ui element.
What could be the main root of the issue? I could debug specific parts if you can point them out.
My educated guess is, there are problems relating the active window and the on-focused element. I have code on my custom engine where the active imgui-window is the one the mouse is hovering. I dont know if that is affecting the focus properties of the InputField.
InputText()owns a copy of the data when active, it won't reload text from the user arg when active.See #3878 , #2890 , #2881 , #1506
implementing the #3290 workaround did the trick.