refactor(controls): use button element for buttons instead of divs closes #1228

This commit is contained in:
moklick
2021-06-16 11:37:41 +02:00
parent 290ba99f70
commit d480d25761
2 changed files with 4 additions and 3 deletions
+3 -3
View File
@@ -23,12 +23,12 @@ export interface ControlProps extends HTMLAttributes<HTMLDivElement> {
onInteractiveChange?: (interactiveStatus: boolean) => void; onInteractiveChange?: (interactiveStatus: boolean) => void;
} }
export interface ControlButtonProps extends HTMLAttributes<HTMLDivElement> {} export interface ControlButtonProps extends HTMLAttributes<HTMLButtonElement> {}
export const ControlButton: FC<ControlButtonProps> = ({ children, className, ...rest }) => ( export const ControlButton: FC<ControlButtonProps> = ({ children, className, ...rest }) => (
<div className={cc(['react-flow__controls-button', className])} {...rest}> <button className={cc(['react-flow__controls-button', className])} {...rest}>
{children} {children}
</div> </button>
); );
const Controls: FC<ControlProps> = ({ const Controls: FC<ControlProps> = ({
+1
View File
@@ -171,6 +171,7 @@
&-button { &-button {
width: 24px; width: 24px;
height: 24px; height: 24px;
border: none;
svg { svg {
width: 100%; width: 100%;