Skip to content
Snippets Groups Projects
Commit a1259ef5 authored by Sergey Mitronin's avatar Sergey Mitronin Committed by Дмитрий Кольцов
Browse files

fix: button focus in safari

parent 63b8cda9
No related branches found
No related tags found
1 merge request!1136chore: incorporate webui submodule
import React from "react";
import React, { useRef } from "react";
import cn from "classnames";
import styles from "./Button.module.scss";
......@@ -22,9 +22,11 @@ export const Button: React.FC<ButtonProps> = (props) => {
rightIcon,
...buttonProps
} = props;
const ref = useRef<HTMLButtonElement>(null);
return (
<button
ref={ref}
{...buttonProps}
className={cn(
styles.container,
......@@ -32,6 +34,12 @@ export const Button: React.FC<ButtonProps> = (props) => {
styles[theme],
buttonProps.className
)}
onClick={(e) => {
if (buttonProps.onClick) {
buttonProps.onClick(e);
}
ref.current?.focus();
}}
disabled={disabled}
>
<span className={styles.content}>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment