Skip to content

Commit

Permalink
fix: added limit to platform tags
Browse files Browse the repository at this point in the history
  • Loading branch information
berezinant committed Nov 18, 2024
1 parent d302e6b commit 283ebfc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DESKTOP_MIN_WIDTH, getScreenType } from '../utils';
const TAGS_MARGIN = 4;
const DROPDOWN_BUTTON_WIDTH_WITH_MARGIN = 44;
const THRESHOLD_GAP = 10;
const MAX_TAGS_COUNT = 8;

/**
* Filter section items are tags with platform names, they should fit in one line.
Expand Down Expand Up @@ -95,7 +96,7 @@ function initFilterSection(): void {
let areTagsDisplayed = false;
items.forEach((item, index) => {
accumulatedWidth += tagsWidths[index] + TAGS_MARGIN;
if (accumulatedWidth < availableWidth) {
if (accumulatedWidth < availableWidth && index < MAX_TAGS_COUNT) {
displayItemAsTag(item);
areTagsDisplayed = true;
} else {
Expand Down

Large diffs are not rendered by default.

0 comments on commit 283ebfc

Please sign in to comment.