refac
This commit is contained in:
@@ -78,15 +78,17 @@
|
||||
}
|
||||
};
|
||||
|
||||
// Debounce only query changes
|
||||
$: if (query !== undefined) {
|
||||
const handleSearchInput = () => {
|
||||
loading = true;
|
||||
clearTimeout(searchDebounceTimer);
|
||||
searchDebounceTimer = setTimeout(() => {
|
||||
page = 1;
|
||||
loadSkillItems();
|
||||
if (page !== 1) {
|
||||
page = 1;
|
||||
} else {
|
||||
loadSkillItems();
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
};
|
||||
|
||||
// Immediate response to page/filter changes
|
||||
$: if (page && viewOption !== undefined) {
|
||||
@@ -321,6 +323,7 @@
|
||||
<input
|
||||
class=" w-full text-sm pr-4 py-1 rounded-r-xl outline-hidden bg-transparent"
|
||||
bind:value={query}
|
||||
on:input={handleSearchInput}
|
||||
aria-label={$i18n.t('Search Skills')}
|
||||
placeholder={$i18n.t('Search Skills')}
|
||||
/>
|
||||
@@ -331,6 +334,7 @@
|
||||
aria-label={$i18n.t('Clear search')}
|
||||
on:click={() => {
|
||||
query = '';
|
||||
handleSearchInput();
|
||||
}}
|
||||
>
|
||||
<XMark className="size-3" strokeWidth="2" />
|
||||
|
||||
Reference in New Issue
Block a user