Skip to content

Commit

Permalink
onClick add focus to button
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Aug 27, 2020
1 parent 2ef14f6 commit 3b118c6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/plugins/kibana_react/public/field_button/field_button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,16 @@ export function FieldButton({

return (
<div className={classes} {...rest}>
<button onClick={onClick} {...buttonProps} className={buttonClasses}>
<button
onClick={(e) => {
if (e.type === 'click') {
e.currentTarget.focus();
}
onClick();
}}
{...buttonProps}
className={buttonClasses}
>
{fieldIcon && <span className="kbnFieldButton__fieldIcon">{fieldIcon}</span>}
{fieldName && <span className="kbnFieldButton__name">{fieldName}</span>}
{fieldInfoIcon && <div className="kbnFieldButton__infoIcon">{fieldInfoIcon}</div>}
Expand Down

0 comments on commit 3b118c6

Please sign in to comment.