focus on SVG element breaks, so added code to ensure that the element has a focus function defined prior to executing the .focus() call.