Skip to content

Commit

Permalink
Dont show setup controls if control is disabled or a function
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen committed Feb 20, 2024
1 parent 332c593 commit cbad3b1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions code/ui/blocks/src/components/ArgsTable/ArgControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import {
RangeControl,
TextControl,
} from '../../controls';
import type { Args, ArgType } from './types';
import type { Args } from './types';
import type { InputType } from '@storybook/types';

export interface ArgControlProps {
row: ArgType;
row: InputType;
arg: any;
updateArgs: (args: Args) => void;
isHovered: boolean;
Expand Down Expand Up @@ -65,7 +66,7 @@ export const ArgControl: FC<ArgControlProps> = ({ row, arg, updateArgs, isHovere
const onBlur = useCallback(() => setFocused(false), []);
const onFocus = useCallback(() => setFocused(true), []);

if (!control || control.disable)
if (!control && row.type !== 'function')
return isHovered ? (
<Link
href="https://storybook.js.org/docs/react/essentials/controls"
Expand Down

0 comments on commit cbad3b1

Please sign in to comment.