Skip to content

Commit 6f2d570

Browse files
committed
refactor: add more detailed comments to visibleOptions of Select
HCRC-178
1 parent cac670c commit 6f2d570

4 files changed

Lines changed: 18 additions & 6 deletions

File tree

apps/events-helsinki/src/domain/search/eventSearch/advancedSearch/AdvancedSearchForm.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ export const AdvancedSearchForm: React.FC<AdvancedSearchFormProps> = ({
202202
value={selectedCategories}
203203
icon={<IconRead aria-hidden />}
204204
noTags
205-
visibleOptions={5.97} // use decimal to make scrollable content visible
205+
// Show next option partially to indicate more is available.
206+
// See more: (https://hds.hel.fi/components/select/code/#component-properties)
207+
visibleOptions={5.97}
206208
theme={{
207209
'--checkbox-background-selected': 'var(--color-input-dark)',
208210
'--checkbox-background-hover': 'var(--color-input-dark)',

apps/hobbies-helsinki/src/domain/search/eventSearch/advancedSearch/AdvancedSearchForm.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ export const AdvancedSearchForm: React.FC<AdvancedSearchFormProps> = ({
193193
value={selectedCategories}
194194
icon={<IconRead aria-hidden />}
195195
noTags
196-
visibleOptions={5.97} // use decimal to make scrollable content visible
196+
// Show next option partially to indicate more is available.
197+
// See more: (https://hds.hel.fi/components/select/code/#component-properties)
198+
visibleOptions={5.97}
197199
theme={{
198200
'--checkbox-background-selected': 'var(--color-input-dark)',
199201
'--checkbox-background-hover': 'var(--color-input-dark)',

apps/sports-helsinki/src/domain/search/combinedSearch/SearchForm.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ export const SimpleSearchForm: React.FC<SearchComponentType> = ({
127127
)
128128
}
129129
options={sportsCategories}
130-
visibleOptions={5.97} // use decimal to make scrollable content visible
130+
// Show next option partially to indicate more is available.
131+
// See more: (https://hds.hel.fi/components/select/code/#component-properties)
132+
visibleOptions={5.97}
131133
texts={{
132134
placeholder: t('search.titleDropdownSportsCategory'),
133135
}}
@@ -151,7 +153,9 @@ export const SimpleSearchForm: React.FC<SearchComponentType> = ({
151153
icon={<IconGroup aria-hidden />}
152154
id="targetGroup"
153155
options={targetGroups}
154-
visibleOptions={5.97} // use decimal to make scrollable content visible
156+
// Show next option partially to indicate more is available.
157+
// See more: (https://hds.hel.fi/components/select/code/#component-properties)
158+
visibleOptions={5.97}
155159
texts={{
156160
placeholder: t('search.titleDropdownTargetGroup'),
157161
}}
@@ -186,7 +190,9 @@ export const SimpleSearchForm: React.FC<SearchComponentType> = ({
186190
),
187191
}}
188192
options={accessibilityProfiles}
189-
visibleOptions={5.97} // use decimal to make scrollable content visible
193+
// Show next option partially to indicate more is available.
194+
// See more: (https://hds.hel.fi/components/select/code/#component-properties)
195+
visibleOptions={5.97}
190196
value={selectedAccessibilityProfile ?? undefined}
191197
onChange={handleAccessibilityProfileOnChange}
192198
icon={<IconPersonWheelchair aria-hidden />}

apps/sports-helsinki/src/domain/search/combinedSearch/searchTabs/SearchTabs.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ function SearchTabListMobile({ data }: SearchTabListMobileProps) {
121121
value={activeTab}
122122
onChange={handleSearchTabChange}
123123
options={options}
124-
visibleOptions={5.97} // use decimal to make scrollable content visible
124+
// Show next option partially to indicate more is available.
125+
// See more: (https://hds.hel.fi/components/select/code/#component-properties)
126+
visibleOptions={5.97}
125127
/>
126128
</div>
127129
);

0 commit comments

Comments
 (0)