Skip to content

Commit

Permalink
fix: remove offset
Browse files Browse the repository at this point in the history
  • Loading branch information
dbajpeyi committed Nov 5, 2024
1 parent 8ad828f commit 39d938b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions injected/src/features/autofill-password-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export default class AutofillPasswordImport extends ContentFeature {
},
zIndex: '984',
borderRadius: '100%',
offsetLeft: 0.03,
offsetTop: 0.03
offsetLeftEm: 0.02,
offsetTopEm: 0
}
}

Expand All @@ -46,8 +46,8 @@ export default class AutofillPasswordImport extends ContentFeature {
},
zIndex: '984',
borderRadius: '100%',
offsetLeft: 0,
offsetTop: 0
offsetLeftEm: 0,
offsetTopEm: 0
}
}

Expand All @@ -62,8 +62,8 @@ export default class AutofillPasswordImport extends ContentFeature {
},
zIndex: '999',
borderRadius: '2px',
offsetLeft: 0.08,
offsetTop: 0.05
offsetLeftEm: 0,
offsetTopEm: -0.05
}
}

Expand Down Expand Up @@ -139,8 +139,8 @@ export default class AutofillPasswordImport extends ContentFeature {
const { top, left, width, height } = elementToCenterOn.getBoundingClientRect()
overlay.style.position = 'absolute'

overlay.style.top = `calc(${top}px + ${window.scrollY}px - ${isRound ? height / 2 : 0}px - 1px - ${style.offsetTop}em)`
overlay.style.left = `calc(${left}px + ${window.scrollX}px - ${isRound ? width / 2 : 0}px - 1px - ${style.offsetLeft}em)`
overlay.style.top = `calc(${top}px + ${window.scrollY}px - ${isRound ? height / 2 : 0}px - 1px - ${style.offsetTopEm}em)`
overlay.style.left = `calc(${left}px + ${window.scrollX}px - ${isRound ? width / 2 : 0}px - 1px - ${style.offsetLeftEm}em)`

const mainElementRect = mainElement.getBoundingClientRect()
overlay.style.width = `${mainElementRect.width}px`
Expand Down

0 comments on commit 39d938b

Please sign in to comment.