Skip to content

Commit 8f0f0b5

Browse files
committed
Button & IconButton: update focusable to be boolean not booleanish string
1 parent a6e9050 commit 8f0f0b5

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

client/common/Button.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ export interface ButtonProps extends React.HTMLAttributes<HTMLElement> {
6969
*/
7070
type?: ButtonTypes;
7171
/**
72-
* Allows for IconButton to pass `focusable="false"` as a prop for SVGs.
73-
* See @types/react > interface SVGAttributes<T> extends AriaAttributes, DOMAttributes<T>
72+
* Controls whether the underlying SVG is focusable.
73+
* Only relevant for IconButton (or buttons that render an SVG as content).
74+
* In SVGs, the `focusable` attribute must be a string (`"true"` or `"false"`),
75+
* but React will automatically convert a boolean prop to the correct string value.
7476
*/
75-
focusable?: boolean | 'true' | 'false';
77+
focusable?: boolean;
7678
}
7779

7880
interface StyledButtonProps extends ButtonProps {

client/common/IconButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const IconButton = ({ icon: Icon, ...otherProps }: IconButtonProps) => (
2424
iconBefore={Icon ? <Icon /> : undefined}
2525
iconOnly
2626
display={Button.displays.inline}
27-
focusable="false"
27+
focusable={false}
2828
{...otherProps}
2929
/>
3030
);

0 commit comments

Comments
 (0)