Under TMS WEB Core 3.0.3.0, TCustomControl.HandleDoKeyPress (the native keypress listener bound to input controls) calls GetKeyChar(AEvent.key) to translate the browser's KeyboardEvent.key into the Char passed to a component's OnKeyPress. When AEvent.key is undefined — which happens with certain synthetic/programmatic key events rather than genuine user keystrokes (in our case, reproducibly reported when a client tapped the Safari QuickType autofill suggestion to fill a saved password on an iPad, on the second login attempt after an initial failed attempt) — GetKeyChar's fallback branch executes the following with no guard:
Result = AValue.charAt(0);
...which throws:
TypeError: undefined is not an object (evaluating 'AValue.charAt')
This aborts the event entirely — no OnKeyPress handler ever fires.
Notably, the sibling function GetKeyCode (used for OnKeyDown/OnKeyUp, same unit) already defends against exactly this case. Its equivalent fallback is:
if (pas.System.Assigned(AValue) && (AValue.length > 0)) {
i = AValue.charCodeAt(1 - 1);
...
}
So GetKeyChar appears to simply be missing the same null/empty check that GetKeyCode already has.
Suggested fix: add an equivalent
Assigned(AValue) and (AValue <> '')guard toGetKeyChar's finalelsebranch, returning#0(matchingIsKeyCharacter's andHandleDoKeyPress's existing handling of a null/#0result) whenAValueis empty or unassigned, instead of unconditionally calling.charAt(0)on it.