Left click on a TextBox causes both EditModeEnter and EditModeExit events to trigger.
RychuP opened this issue · 2 comments
RychuP commented
As per title.
Chris3606 commented
I took a quick look through the source:
- Setting DisableKeyboard to
true
triggersEditModeExit
,false
triggersEditModeEnter
. - OnLeftMouseClicked sets this property to
false
. This would triggerEditModeEnter
. - Later on in
OnLeftMouseClicked
, the text box is set to the focused object. This should ultimately trigger Focused(), which setsDisableKeyboard
totrue
. This will triggerEditModeExit
.
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
Edit mode was removed in v10 so this bug is technically fixed 😁