Skip to content

Commit

Permalink
Merge pull request #77 from HootDunk/frontend/fix-clearing-group-does…
Browse files Browse the repository at this point in the history
…-not-refresh-list

Frontend: Clearing group does not refresh the list
  • Loading branch information
jrw972 committed Jan 3, 2024
2 parents cba780f + d4287ec commit d05efd9
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions frontend/src/lib/ComboBox.svelte
Expand Up @@ -72,7 +72,7 @@
onMount(async () => {
groupContext.subscribe((value) => {
if(value?.name) searchGroups = value.name;
if (value?.name) searchGroups = value.name;
});
// Changes the text in the Modal's group field placeholder
Expand Down Expand Up @@ -213,6 +213,12 @@
rootMargin: '20px',
unobserveOnEnter: true
};
function clearSelection() {
selectedGroup = '';
searchGroups = '';
groupContext.set('clear');
}
</script>
<div class="container">
Expand Down Expand Up @@ -254,19 +260,17 @@
}}
on:blur={() => {
status = 'blur';
if (!selectedGroup.name) groupContext.set();
if (!selectedGroup) {
clearSelection();
}
}}
/>
{#if ((isGroupContext && selectedGroup) || $groupContext) && !$isSingleGroup}
<button
class="button-blue"
style="cursor: pointer; width: 3.6rem; height: 1.7rem; margin-top: 1.75rem; margin-left: 1rem "
on:click={() => {
selectedGroup = '';
searchGroups = '';
groupContext.set('clear');
}}
on:click={clearSelection}
>
{messages['group.context']['search.clear.button']}
</button>
Expand Down

0 comments on commit d05efd9

Please sign in to comment.