Browse Source

82974 warnings 2

Mao 4 năm trước cách đây
mục cha
commit
408335f7f0

+ 7 - 2
packages/app/src/components/SearchPage/SearchPageLayout.tsx

@@ -40,9 +40,14 @@ const SearchPageLayout: FC<Props> = (props: Props) => {
               <div className="input-group-prepend">
                 <label className="input-group-text text-secondary" htmlFor="inputGroupSelect01">{t('search_result.number_of_list_to_display')}</label>
               </div>
-              <select className="custom-select" id="inputGroupSelect01" onChange={(e) => { props.onPagingLimitChanged(Number(e.target.value)) }}>
+              <select
+                defaultValue={props.initialPagingLimit}
+                className="custom-select"
+                id="inputGroupSelect01"
+                onChange={(e) => { props.onPagingLimitChanged(Number(e.target.value)) }}
+              >
                 {[20, 50, 100, 200].map((limit) => {
-                  return <option selected={limit === props.initialPagingLimit} value={limit} key={limit}>{limit}{t('search_result.page_number_unit')}</option>;
+                  return <option value={limit} key={limit}>{limit}{t('search_result.page_number_unit')}</option>;
                 })}
               </select>
             </div>