I’ve been trying to track down an intermittent problem with my app for ages and finally figured it out: if you create a multiline TMP input field with no scrollbar and use the mouse wheel with the mouse over the input field, the caret will stop flashing (will stay on or off depending what it was at the time). If you then click off the input field, the OnEndEdit event is not fired.
Am going to go digging in the source folder as this is a massive issue for the app I’m creating. Will report back if I find a fix.
EDIT: Found it. Pretty clear cut actually:
If you go look in TMP_InputField.cs, you’ll find this method:
public virtual void OnScroll(PointerEventData eventData)
In this method there’s a commented line:
// Disable focus until user re-selected the input field.
m_AllowInput = false;
The problem is, the end-edit cleanup activity, including dispatching the OnEndEdit event, is gated behind m_AllowInput being true. So if the last thing you do before clicking off a multi-line input field is scroll the mouse, you won’t get the OnEndEdit callback.
I was able to reproduce the above issue and have resolved it.
While looking at this, I also uncovered that when using a script with OnScroll Event, the Input Field incorrectly scrolls when in Single Line mode. This has also been resolved.
I also modified the behavior where OnEndEdit is not called when using a Scrollbar assigned to the Input Field. Thoughts on this part?
I also modified the behavior where OnEndEdit is not called when using a Scrollbar assigned to the Input Field. Thoughts on this part?
Sorry, didn’t see this reply earlier. I mentioned ‘no scroll bar’ in the original report but as it turned out it wasn’t related to the lack of scroll bar, just the status change when using the scroll wheel. If there were other problems I never encountered them