ImGui.NET icon indicating copy to clipboard operation
ImGui.NET copied to clipboard

setting maxLength in InputText to UInt32.MaxValue breaks the textbox

Open joonjoonjoon opened this issue 2 years ago • 2 comments

I wanted a textfield with no limit, and Rider auto-suggested UInt32.MaxValue I couldn't get it to read characters or numbers, but backspace somehow worked. Once I set it to a sensible value it started working.

To clarify, this line ImGui.InputTextMultiline("output", ref consoleOutput, UInt32.MaxValue, new Vector2(300,300)); Gives me a text-field in which backspace is registered (so inputs work) but other characters are not.

Changing it to this makes it work ImGui.InputTextMultiline("output", ref consoleOutput, 100, new Vector2(300,300));

I do not require the first line to work, it just feels like a common error to make. Behaviour observed on macOS.

joonjoonjoon avatar Jan 18 '23 15:01 joonjoonjoon

yep, also Int32.MaxValue - 100 crashes the ImGui.NET :D

zaafar avatar Jan 22 '23 21:01 zaafar

however, UInt16.MaxValue works. so maybe somehow size_t is evaluating to 16bits rather than 32bits...hmm. weird.

zaafar avatar Jan 22 '23 21:01 zaafar