param element export const changeFocus = ( element ) => { if ( document . activeElement === element || ! element ) { return ; } if ( element instanceof HTMLElement ) { if ( typeof KeyboardEvent === 'function' ) { const event = new KeyboardEvent ( 'keydown' , { bubbles : true , key : 'Unidentified' } ) ; element . dispatchEvent ( event ) ; } element . focus ( ) ; } } ;