Undo typing dialog appears often recently, in Safari
Go to settings -> general -> accessibility and look for shake to undo. If enabled that box should appear when you shake the device. 

If you don’t want it turn it off.