fix: default btn position
This commit is contained in:
parent
4e92c06791
commit
8cc089357f
|
@ -141,8 +141,6 @@ export class BtnList {
|
||||||
newParent.append(...this.list.map(e => cloneBtn(e)))
|
newParent.append(...this.list.map(e => cloneBtn(e)))
|
||||||
shadow.append(newParent)
|
shadow.append(newParent)
|
||||||
|
|
||||||
// default position
|
|
||||||
newParent.style.top = '0px'
|
|
||||||
try {
|
try {
|
||||||
const anchorDiv = this.getBtnParent()
|
const anchorDiv = this.getBtnParent()
|
||||||
const pos = () => this._positionBtns(anchorDiv, newParent)
|
const pos = () => this._positionBtns(anchorDiv, newParent)
|
||||||
|
@ -156,6 +154,8 @@ export class BtnList {
|
||||||
scroll.addEventListener('scroll', pos, { passive: true })
|
scroll.addEventListener('scroll', pos, { passive: true })
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
|
// default position
|
||||||
|
newParent.style.top = `${window.innerHeight - newParent.getBoundingClientRect().height}px`
|
||||||
}
|
}
|
||||||
|
|
||||||
return btnParent
|
return btnParent
|
||||||
|
|
Loading…
Reference in New Issue