Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend: Clearing group does not refresh the list #77

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions frontend/src/lib/ComboBox.svelte
Original file line number Diff line number Diff line change
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
Loading