Here's a codepen to demonstrate what I'm seeing: https://codepen.io/anon/pen/zMvxPy
HTML:
<input type="text" />
JS:
$('input').on('focus', () => {
console.log('focused...')
});
$('input').focus();
On Chrome, the text input will receive focus and the "focus" event is fired. On Firefox (63.0.1), the text input is not focused and the focus event is not fired.
You can, however, click on the text input and the "focus" event will fire properly.
Any explanations as to why the .focus() method isn't firing the "focus" event in Firefox...?
Note: I'm aware that calling .focus() works via something like a button click (as in https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#Focus_on_a_text_field) but this example is for calling .focus() during the initial page load.