fix: POS Item Cart non-stop scroll issue (#26692)

This commit is contained in:
Subin Tom 2021-08-02 11:37:38 +05:30 committed by GitHub
parent 58118d7830
commit 3b7615750a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -564,7 +564,6 @@ erpnext.PointOfSale.ItemCart = class {
)
set_dynamic_rate_header_width();
this.scroll_to_item($item_to_update);
function set_dynamic_rate_header_width() {
const rate_cols = Array.from(me.$cart_items_wrapper.find(".item-rate-amount"));
@ -639,12 +638,6 @@ erpnext.PointOfSale.ItemCart = class {
$($img).parent().replaceWith(`<div class="item-image item-abbr">${item_abbr}</div>`);
}
scroll_to_item($item) {
if ($item.length === 0) return;
const scrollTop = $item.offset().top - this.$cart_items_wrapper.offset().top + this.$cart_items_wrapper.scrollTop();
this.$cart_items_wrapper.animate({ scrollTop });
}
update_selector_value_in_cart_item(selector, value, item) {
const $item_to_update = this.get_cart_item(item);
$item_to_update.attr(`data-${selector}`, escape(value));