Fix to invoke InputField and TMP_InputField events#276
Merged
nowsprinting merged 6 commits intomasterfrom Oct 26, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances input field operator handling to properly invoke events for both legacy InputField and TMP_InputField components. Previously, text was set directly without triggering associated events, which could cause issues with validation and event-driven UI updates.
Key Changes
- Invokes onSubmit and onEndEdit events after text input for InputField
- Adds onValidateInput event support with per-character validation for TMP_InputField
- Sends onTouchScreenKeyboardStatusChanged event for TMP_InputField on non-standalone platforms
- Removes direct OnSelect event to prevent unwanted TouchScreenKeyboard display
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
Runtime/Operators/UguiTextInputOperator.cs |
Enhanced text input operator to invoke input field events properly |
Tests/Runtime/Operators/UguiTextInputOperatorTest.cs |
Updated test names for clarity and added validation test |
Annotations/InputFieldAnnotation.cs |
Updated documentation to include TMP_InputField |
Samples~/uGUI Demo/Scripts/Runtime/EventHandlers/SpyInputFieldEventReceiver.cs |
New event receiver for testing input field events |
Samples~/uGUI Demo/Scripts/Runtime/EventHandlers/AbstractSpyEventHandler.cs |
Added support for InputField and keyboard events |
Samples~/uGUI Demo/Scenes/uGUIDemo.unity |
Added UI components for TMP_InputField testing |
Samples~/uGUI Demo/Tests/Runtime/TextInputOperatorTest.cs |
Split test into separate tests for Legacy and TMP inputs |
Samples~/uGUI Demo/Scripts/Runtime/TestHelper.UI.Samples.UguiDemo.asmdef |
Added Unity.TextMeshPro reference |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
45d4077 to
3ba2d46
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
12ddd31 to
ea17aab
Compare
This comment has been minimized.
This comment has been minimized.
ea17aab to
6f43a07
Compare
Code Metrics Report
Details | | master (dd60ab6) | #276 (6f086aa) | +/- |
|---------------------|------------------|----------------|--------|
- | Coverage | 89.2% | 88.7% | -0.5% |
| Files | 69 | 70 | +1 |
| Lines | 2393 | 2512 | +119 |
+ | Covered | 2135 | 2230 | +95 |
- | Code to Test Ratio | 1:1.3 | 1:1.3 | -0.1 |
| Code | 4371 | 4521 | +150 |
+ | Test | 6077 | 6098 | +21 |
+ | Test Execution Time | 11m50s | 10m38s | -1m12s |Code coverage of files in pull request scope (87.7% → 84.2%)
Reported by octocov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before
Set it directly to the
textproperty.Do not send InputField and TMP_InputField events.
After
InputField:
TMP_InputField:
Also, the
TouchScreenKeyboardis no longer opened when text entry begins.