Skip to content

Commit be92759

Browse files
committed
Allow one items.
1 parent bd6aba3 commit be92759

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/components/primer/alpha/segmented_control.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def initialize(hide_labels: HIDE_LABELS_DEFAULT, full_width: FULL_WIDTH_DEFAULT,
6060
end
6161

6262
def render?
63-
valid_items_count = items.count <= (@hide_labels ? 6 : 5) && items.count >= 2
64-
raise ArgumentError, "A segmented control should have 2–5 choices with text labels, or up to 6 icon-only buttons." if !valid_items_count && !Rails.env.production?
63+
valid_items_count = items.count <= (@hide_labels ? 6 : 5) && items.count >= 1
64+
raise ArgumentError, "A segmented control should have 1–5 choices with text labels, or up to 6 icon-only buttons." if !valid_items_count && !Rails.env.production?
6565

6666
valid_items_count
6767
end

0 commit comments

Comments
 (0)