mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-22 02:34:26 +08:00
fix the selected item not in the center sometimes
This commit is contained in:
@@ -112,7 +112,7 @@ export function scrollToSelectedItem(parentEl: Framework7Dom, containerSelector:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const containerPaddingTop = getNumberValue(container.css('padding-top'), 0);
|
const containerPaddingTop = getNumberValue(container.css('padding-top'), 0) / 2;
|
||||||
|
|
||||||
let targetPos = selectedItem.offset().top - container.offset().top - containerPaddingTop
|
let targetPos = selectedItem.offset().top - container.offset().top - containerPaddingTop
|
||||||
- (container.outerHeight() - selectedItem.outerHeight()) / 2;
|
- (container.outerHeight() - selectedItem.outerHeight()) / 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user