Update to correct active element finding when using synthetic events.

Fixes issue #6088.