We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 70960b4 + eb61dc0 commit b2b3f68Copy full SHA for b2b3f68
1 file changed
components/common/dropdowns/mobileDropdown.tsx
@@ -1,4 +1,4 @@
1
-import { useState } from 'react';
+import { useEffect, useState } from 'react';
2
3
import Image from 'next/image';
4
@@ -61,6 +61,12 @@ export default function MobileDropdown({
61
break;
62
}
63
64
+ useEffect(() => {
65
+ if (!dropdownOptions.includes(sortOption)) {
66
+ setSort(dropdownOptions[0] as DropdownOptionProps);
67
+ }
68
+ }, []);
69
+
70
const handleOptionSelected = (value: DropdownOptionProps) => () => {
71
setShowBottom(false);
72
0 commit comments