This commit is contained in:
sairaj mote 2023-10-21 04:43:12 +05:30
parent 295d566d5e
commit a01d15412b
2 changed files with 4 additions and 3 deletions

View File

@ -521,9 +521,10 @@ customElements.define('sm-input',
updatePosition = () => {
requestAnimationFrame(() => {
this.dimensions = this.getBoundingClientRect()
this.scrollingParentDimensions = this.scrollingParent.getBoundingClientRect()
if (this.dimensions.width === 0 || this.dimensions.height === 0) return;
let topOffset = this.dimensions.top + this.dimensions.height;
let leftOffset = this.dimensions.left;
let topOffset = this.dimensions.top - this.scrollingParentDimensions.top + this.dimensions.height;
let leftOffset = this.dimensions.left - this.scrollingParentDimensions.left;
const maxWidth = this.dimensions.width
this.feedbackPopover.style = `top: ${topOffset}px; left: ${leftOffset}px; max-width: ${maxWidth}px;`
})

File diff suppressed because one or more lines are too long