Skip to content

Commit 0e70641

Browse files
authored
fix: ignore buttons from bulk selection in sharepoint (#782)
* fix: ignore buttons from bulk selection in sharepoint
1 parent a6a127a commit 0e70641

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/extension/app/store/bulk.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export class BulkStore {
159159
return [...document.querySelectorAll('#appRoot [aria-selected="true"]:not([aria-checked="true"]')]
160160
// exclude folders
161161
.filter((row) => !row.querySelector('img')?.getAttribute('src').includes('/foldericons/')
162+
&& !row.getAttribute('type')?.includes('button')
162163
&& !row.querySelector('img')?.getAttribute('src').endsWith('folder.svg')
163164
&& !row.querySelector('svg')?.parentElement.className.toLowerCase().includes('folder'))
164165
// extract file name and type

test/fixtures/content-sources.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ export function mockSharePointRoot() {
196196
const container = document.createElement('div');
197197
container.setAttribute('role', 'presentation');
198198
root.appendChild(container);
199+
200+
const allDocumentsButton = document.createElement('button');
201+
allDocumentsButton.textContent = 'All Documents';
202+
allDocumentsButton.setAttribute('type', 'button');
203+
allDocumentsButton.setAttribute('aria-label', 'All Documents');
204+
allDocumentsButton.setAttribute('aria-selected', 'true');
205+
root.appendChild(allDocumentsButton);
199206
return root;
200207
}
201208

0 commit comments

Comments
 (0)