[1.6.x] Fixed #21496 -- Fixed crash when GeometryField uses TextInput

Thanks Rhett Garber for the report and initial patch.
Backport of 34b8a3855 from master.