Skip to content

fix(block-adding): prevent data loss when using select all with search #1504

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

Merged
merged 2 commits into from
Jul 11, 2025
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions packages/common/component/SelectAll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ const props = defineProps({

const emit = defineEmits(['selectAll'])

const filterList = computed(() => props.allItems.filter((item) => props.selected.some((i) => item.id === i.id)))

const selectedAll = computed({
get() {
return props.allItems.length > 0 && props.allItems.length === props.selected.length
return props.allItems.length > 0 && props.allItems.length === filterList.value.length
},
set(value) {
if (value) {
Expand All @@ -38,5 +40,5 @@ const selectedAll = computed({
}
})

const isIndeterminate = computed(() => props.selected.length > 0 && props.selected.length !== props.allItems.length)
const isIndeterminate = computed(() => filterList.value.length > 0 && filterList.value.length !== props.allItems.length)
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,7 @@ export default {
const selectedBlockFilter = (blocks) => {
const isInBlockGroup = (block) => includesBlockInGroups(block.id)

const isSelectedBlock = (block) =>
selectedBlockArray?.value?.some((selectedBlock) => block.id === selectedBlock.id)

return blocks.filter((block) => !isInBlockGroup(block) && !isSelectedBlock(block))
return blocks.filter((block) => !isInBlockGroup(block))
}

const searchBlocks = (filters) => {
Expand Down