Skip to content

Commit

Permalink
Fix visual controls bug
Browse files Browse the repository at this point in the history
  • Loading branch information
vocksel committed Nov 9, 2024
1 parent 3745772 commit 8a43b16
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Storybook/StoryControls.luau
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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

Expand Down

0 comments on commit 8a43b16

Please sign in to comment.