diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index 6a6fda764e9..b55060fd140 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -117,7 +117,14 @@ td { font-family: "Lato","Lucida Grande", Helvetica, Verdana, Arial; color: #555555; font-size: 12px; - position: absolute; + /* Some elements inside .pos are allowed to be moved/resized. When + * this 'move/resize' event is performed in touch devices, .pos + * element also tries to scroll (as the default action of touchstart+ + * touchmove events). + * Position is fixed to prevent the movement of .pos element during + * the described touch events. + */ + position: fixed; left: 0; top: 0; width: 100%; diff --git a/addons/point_of_sale/static/src/js/Chrome.js b/addons/point_of_sale/static/src/js/Chrome.js index ce6c340fa06..d54b5f22170 100644 --- a/addons/point_of_sale/static/src/js/Chrome.js +++ b/addons/point_of_sale/static/src/js/Chrome.js @@ -357,7 +357,6 @@ odoo.define('point_of_sale.Chrome', function(require) { this.state.uiState.hasBigScrollBars = true; } - this._disableRubberbanding(); this._disableBackspaceBack(); this._replaceCrashmanager(); } @@ -381,38 +380,6 @@ odoo.define('point_of_sale.Chrome', function(require) { }, }); } - _disableRubberbanding() { - var self = this; - - document.body.addEventListener('touchstart', function (event) { - self.previous_touch_y_coordinate = event.touches[0].clientY; - }); - - // prevent the pos body from being scrollable. - document.body.addEventListener('touchmove', function (event) { - var node = event.target; - var current_touch_y_coordinate = event.touches[0].clientY; - var scrolling_down; - - if (current_touch_y_coordinate < self.previous_touch_y_coordinate) { - scrolling_down = true; - } else { - scrolling_down = false; - } - - while (node) { - if ( - node.classList && - node.classList.contains('touch-scrollable') && - self._scrollable(node, scrolling_down) - ) { - return; - } - node = node.parentNode; - } - event.preventDefault(); - }); - } // prevent backspace from performing a 'back' navigation _disableBackspaceBack() { $(document).on('keydown', function (e) { @@ -421,21 +388,6 @@ odoo.define('point_of_sale.Chrome', function(require) { } }); } - _scrollable(element, scrolling_down) { - var $element = $(element); - var scrollable = true; - - if (!scrolling_down && $element.scrollTop() <= 0) { - scrollable = false; - } else if ( - scrolling_down && - $element.scrollTop() + $element.height() >= element.scrollHeight - ) { - scrollable = false; - } - - return scrollable; - } } Chrome.template = 'Chrome'; diff --git a/addons/point_of_sale/static/src/xml/ChromeWidgets/OrderSelector.xml b/addons/point_of_sale/static/src/xml/ChromeWidgets/OrderSelector.xml index c557c620107..000a743da04 100644 --- a/addons/point_of_sale/static/src/xml/ChromeWidgets/OrderSelector.xml +++ b/addons/point_of_sale/static/src/xml/ChromeWidgets/OrderSelector.xml @@ -3,7 +3,7 @@
- + diff --git a/addons/point_of_sale/static/src/xml/Popups/SelectionPopup.xml b/addons/point_of_sale/static/src/xml/Popups/SelectionPopup.xml index ec250a913f7..4048edd7b3d 100644 --- a/addons/point_of_sale/static/src/xml/Popups/SelectionPopup.xml +++ b/addons/point_of_sale/static/src/xml/Popups/SelectionPopup.xml @@ -8,7 +8,7 @@
-
+
diff --git a/addons/point_of_sale/static/src/xml/Screens/ClientListScreen/ClientListScreen.xml b/addons/point_of_sale/static/src/xml/Screens/ClientListScreen/ClientListScreen.xml index fc0fc649b50..5096d92c49f 100644 --- a/addons/point_of_sale/static/src/xml/Screens/ClientListScreen/ClientListScreen.xml +++ b/addons/point_of_sale/static/src/xml/Screens/ClientListScreen/ClientListScreen.xml @@ -48,7 +48,7 @@
-
+
diff --git a/addons/point_of_sale/static/src/xml/Screens/ProductScreen/ProductsWidgetControlPanel.xml b/addons/point_of_sale/static/src/xml/Screens/ProductScreen/ProductsWidgetControlPanel.xml index e3e9836d447..c80a2a6d1ef 100644 --- a/addons/point_of_sale/static/src/xml/Screens/ProductScreen/ProductsWidgetControlPanel.xml +++ b/addons/point_of_sale/static/src/xml/Screens/ProductScreen/ProductsWidgetControlPanel.xml @@ -28,7 +28,7 @@
-
+
diff --git a/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/ReceiptScreen.xml b/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/ReceiptScreen.xml index 659f2980bd5..2a792ded92e 100644 --- a/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/ReceiptScreen.xml +++ b/addons/point_of_sale/static/src/xml/Screens/ReceiptScreen/ReceiptScreen.xml @@ -16,7 +16,7 @@ Next Order
-
+