From 8a43b16cbef87d1a587729d92237fd4ae95d07dc Mon Sep 17 00:00:00 2001 From: Marin Minnerly Date: Sat, 9 Nov 2024 07:58:59 -0800 Subject: [PATCH] Fix visual controls bug --- src/Storybook/StoryControls.luau | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Storybook/StoryControls.luau b/src/Storybook/StoryControls.luau index e689f821..213c0912 100644 --- a/src/Storybook/StoryControls.luau +++ b/src/Storybook/StoryControls.luau @@ -111,7 +111,7 @@ local function StoryControls(props: Props) TextTruncate = Enum.TextTruncate.AtEnd, }), - Option = e("Frame", { + OptionWrapper = e("Frame", { LayoutOrder = 2, BackgroundTransparency = 1, Size = UDim2.fromScale(1, 0), @@ -120,7 +120,12 @@ local function StoryControls(props: Props) Flex = e("UIFlexItem", { FlexMode = Enum.UIFlexMode.Shrink, }), - }, option), + }, { + -- Keying by the identity of sortedControls fixes a bug where + -- the options visually do not update when two stories have the + -- exact same controls + [`Option_{sortedControls}`] = option, + }), }) end