Improve focusin detection support

This change prevents unintentional scrolling and unfocusing of
whatever element was in focus before the feature detect in browsers
that need to do the long feature detect.

Adds test case.

Refs #17599