Skip to content

Commit

Permalink
ListPairs Usability - disable the clear filter button if nothing to c…
Browse files Browse the repository at this point in the history
…lear.
  • Loading branch information
jmchilton committed Dec 4, 2024
1 parent 054f33e commit 8f985a3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ const hasFilter = computed(() => forwardFilter.value || reverseFilter.value);
const strategy = ref(autoPairLCS);
const duplicatePairNames = ref<string[]>([]);
const canClearFilters = computed(() => {
return forwardFilter.value || reverseFilter.value;
});
const canAutoPair = computed(() => {
return forwardFilter.value && reverseFilter.value;
});
Expand Down Expand Up @@ -1156,6 +1160,7 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) {
<BButtonGroup vertical>
<BButton
class="clear-filters-link"
:disabled="!canClearFilters"
size="sm"
:variant="hasFilter ? 'danger' : 'secondary'"
@click="clickClearFilters">
Expand Down

0 comments on commit 8f985a3

Please sign in to comment.