Description:
When using a TMP_InputField with ContentType set to Custom and characterValidation set to Regex, the WebGLInput wrapper attempts to map the TMP enum value to the standard InputField.CharacterValidation enum. Since Regex is not defined in the standard enum, this results in a System.ArgumentException:
Requested value 'Regex' was not found.
Steps to Reproduce:
- Create a TMP_InputField in Unity.
- Set ContentType to Custom.
- Set characterValidation to Regex.
- Attempt to set the input field value via the WebGLInput wrapper.
Expected Behavior:
Setting the value should not throw an exception.
Actual Behavior:
An exception is thrown due to an unsupported enum value mapping.
Suggested Fix:
Add a check to ensure only supported enum values are mapped, and fallback to a default value (e.g., None) for unsupported values like Regex.
Description:
When using a
TMP_InputFieldwithContentTypeset toCustomandcharacterValidationset toRegex, the WebGLInput wrapper attempts to map the TMP enum value to the standardInputField.CharacterValidationenum. SinceRegexis not defined in the standard enum, this results in aSystem.ArgumentException:Steps to Reproduce:
Expected Behavior:
Setting the value should not throw an exception.
Actual Behavior:
An exception is thrown due to an unsupported enum value mapping.
Suggested Fix:
Add a check to ensure only supported enum values are mapped, and fallback to a default value (e.g., None) for unsupported values like Regex.