I have a focus handler on a textfield:

```
$("#input").on("focus", (e) => {
    // do some stuff
});

```

When I right-click, however, I don't want that focus handler to be executed, so I did:

```
$("#input").on("mousedown", (e) => {
    if (e.button === 2) { // right click
        e.preventDefault();
    }
});

```

However, that also prevents the textfield from ever getting focus when I right-click. I still want it to get focus, I just don't want the handler to execute, so I triggered the handler manually:

```
$("#input").on("mousedown", (e) => {
    if (e.button === 2) { // right click
        e.preventDefault();
        $("#input").trigger("focus", true);
    }
});

$("input").on("focus", (e, someParam) => {
    if (someParam) return;
    // do some stuff
});

```

This way, the textfield gets focus, but we immediately return out of the handler.

The problem I noticed is that the first time I trigger the focus handler, `someParam` is `undefined` and we end up executing `do some stuff`. For all subsequent right-clicks, `someParam` is true.

I commented out the line that triggers the focus handler, and indeed, the focus handler is never executed, because we call `preventDefault`, so it seems that the first execution of the handler necessarily comes from `$("#input").trigger("focus", true);`. So why then is `someParam` undefined if I'm passing in `true` as the extra parameter?

[JsFiddle](https://jsfiddle.net/bjj56eua/). Tested in Chrome.