I have a form that is showing this as an error in the console on Chrome. It seems to still be working, but just wondered if possibly there's a bug in the code or if there is something I am doing wrong that could be triggering this error. It's a simple form with two edit boxes and a button.
WEBLib.Controls.pas:3811 Uncaught TypeError: Cannot read property 'charAt' of undefined
at Object.HandleDoInput (WEBLib.Controls.pas:3811)
at HTMLInputElement.cb (rtl.js:217)
HandleDoInput | @ | WEBLib.Controls.pas:3811 | |
cb | @ | rtl.js:217 |
WEBLib.Controls is showing this function as creating the error.
I am on Web Core 1.4.1.0
function TControl.HandleDoInput(Event: TJSInputEvent): Boolean;
var
c: Char;
stemp: string;
begin
//Note: On Android the OnKeyPress event is not triggered.
//The OnInput event is used instead to trigger the OnKeyPress event.
if IsAndroid then
begin
FElementEvent := Event;
if (eeKeyPress in EventStopPropagation) then
StopPropagation;
c := #0;
if Event.Data <> '' then
begin
stemp := Event.Data;
c := stemp[Length(stemp)]; <---Showing Error in Console of Chrome
KeyPress(c);
end;
Result := True;
if c = #0 then
PreventDefault;
FElementEvent := nil;
end;
end;