ImGuiNET / ImGui.NET

An ImGui wrapper for .NET.
MIT License
1.87k stars 304 forks source link

setting maxLength in InputText to UInt32.MaxValue breaks the textbox #381

Open joonjoonjoon opened 1 year ago

joonjoonjoon commented 1 year ago

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.

zaafar commented 1 year ago

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

zaafar commented 1 year ago

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