Thraka / SadConsole

A .NET ascii/ansi console engine written in C# for MonoGame and XNA. Create your own text roguelike (or other) games!
MIT License
1.23k stars 120 forks source link

Left click on a TextBox causes both EditModeEnter and EditModeExit events to trigger. #312

Closed RychuP closed 1 year ago

RychuP commented 1 year ago

As per title.

Chris3606 commented 1 year ago

I took a quick look through the source:

It seems odd to me that Focused() is setting DisableKeyboard to true; I would expect it to set false, so as to trigger the edit mode enter event. Even if it did, though, it looks like it would end up triggering EditModeEnter twice on click; once in OnLeftMouseClick, and once in focus. Having it in both places, makes sense in theory, because the control can be focused without the use of the mouse and it should probably still trigger EditModeEnter; but probably there should be some sort of guard on one or more of these property setters to prevent firing the event multiple times in a row?

Thraka commented 1 year ago

Edit mode was removed in v10 so this bug is technically fixed 😁