how to detect click in dom programatically [closed]

I have an input field with an onBlur event that triggers a temp() method when the user leaves the field. There’s also a Save button, and when the Save button is clicked manually, the input field loses focus (triggers blur) automatically, which calls the temp() method, followed by the Save operation.

However, when using a keyboard shortcut, I cannot call the Save method directly. Instead, I have to simulate a button click programmatically. In this case, the input field does not lose focus, so the onBlur event is not triggered, and the temp() method doesn’t execute. How can I ensure the onBlur event is triggered when the Save button is clicked programmatically via a keyboard shortcut?
in angular

i only tried this way