Skip to content

Commit

Permalink
fix type and update rectNotZero function
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Bassler authored and Evan Bassler committed Jan 13, 2025
1 parent e878578 commit a3ce34c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/browser/src/autofill/background/overlay.background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import {
generateDomainMatchPatterns,
generateRandomChars,
isInvalidResponseStatusCode,
rectNotZero,
rectHasSize,
specialCharacterToKeyMap,
} from "../utils";

Expand Down Expand Up @@ -1402,10 +1402,10 @@ export class OverlayBackground implements OverlayBackgroundInterface {
}
// Calculate the smallest left and largest right values to determine width
const left = Math.min(
...filteredObjects.filter((obj) => rectNotZero(obj.rect)).map((obj) => obj.rect.left),
...filteredObjects.filter((obj) => rectHasSize(obj.rect)).map((obj) => obj.rect.left),
);
const largestRight = Math.max(
...filteredObjects.filter((obj) => rectNotZero(obj.rect)).map((obj) => obj.rect.right),
...filteredObjects.filter((obj) => rectHasSize(obj.rect)).map((obj) => obj.rect.right),
);

const width = largestRight - left;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
});
}

/**his.formFieldElements
/**
* Gets the bounding client rects for the most recently focused field. This method will
* attempt to use an intersection observer to get the most recently focused field's
* bounding client rects. If the intersection observer is not supported, or the
Expand Down

0 comments on commit a3ce34c

Please sign in to comment.