While the solution provided may work, it may not be the optimal choice.
One alternative approach is to customize the input/button outline by adjusting the variables. (Especially since the query is about using bootstrap 4)
If you decide to modify the Bootstrap 4 variables as shown here, you can apply the following code to eliminate all focus outlines:
$input-btn-focus-box-shadow: none;
$input-btn-focus-width: 0;
To only remove the button focus outline, you can use the following code:
$btn-focus-box-shadow: none;
This customization can also be extended to indicators, select, dropdown, etc. by referring to the default variables list of bootstrap 4
EDIT
This method is also applicable for v5: GitHub variables
Although disabling the focus outline is possible, it may not be recommended. Following web accessibility keyboard standards, a site should be navigable via tabbing. Disabling the CSS can hinder this functionality.
To cater to different user needs, a new pseudo class has been introduced: :focus-visible
, which can be utilized, though compatibility across all platforms is not universal yet. Check out the Chromium changelog for more information