@enact/ui 4.1.1 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  The following is a curated list of changes in the Enact ui module, newest changes on the top.
4
4
 
5
+ ## [4.1.2] - 2021-12-22
6
+
7
+ ### Fixed
8
+
9
+ - `ui/Scroller` and `ui/VirtualList` to avoid stuttering of content on drag in mobile devices
10
+ - `ui/Scroller` and `ui/VirtualList` to scroll correctly on Android platform for RTL locales
11
+
5
12
  ## [4.1.1] - 2021-11-30
6
13
 
7
14
  No significant changes.
@@ -761,7 +761,7 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
761
761
  // VirtualList and VirtualGridList DO NOT receive `onscroll` event.
762
762
  // Only Scroller could get `onscroll` event.
763
763
 
764
- if (!_this.animator.isAnimating() && childRefCurrent && childRefCurrent.containerRef.current && childRefCurrent.getRtlPositionX) {
764
+ if (!_this.animator.isAnimating() && childRefCurrent && childRefCurrent.containerRef.current && childRefCurrent.getRtlPositionX && !_this.isDragging) {
765
765
  // For Scroller
766
766
  childRefCurrent.containerRef.current.scrollTop = _this.scrollTop;
767
767
  childRefCurrent.containerRef.current.scrollLeft = childRefCurrent.getRtlPositionX(_this.scrollLeft);
@@ -389,7 +389,7 @@ var ScrollableBaseNative = /*#__PURE__*/function (_Component) {
389
389
  }
390
390
 
391
391
  if (_this.props.rtl && canScrollHorizontally) {
392
- scrollLeft = _platform.platform.ios || _platform.platform.safari || _platform.platform.chrome >= 85 ? -scrollLeft : bounds.maxLeft - scrollLeft;
392
+ scrollLeft = _platform.platform.ios || _platform.platform.safari || _platform.platform.chrome >= 85 || _platform.platform.androidChrome >= 85 ? -scrollLeft : bounds.maxLeft - scrollLeft;
393
393
  }
394
394
 
395
395
  if (scrollLeft !== _this.scrollLeft) {
@@ -93,7 +93,7 @@ var ScrollerBasic = /*#__PURE__*/function (_Component) {
93
93
 
94
94
  _this.getRtlPositionX = function (x) {
95
95
  if (_this.props.rtl) {
96
- return _platform.platform.ios || _platform.platform.safari || _platform.platform.chrome >= 85 ? -x : _this.scrollBounds.maxLeft - x;
96
+ return _platform.platform.ios || _platform.platform.safari || _platform.platform.chrome >= 85 || _platform.platform.androidChrome >= 85 ? -x : _this.scrollBounds.maxLeft - x;
97
97
  }
98
98
 
99
99
  return x;
@@ -89,7 +89,7 @@ var ScrollerBase = /*#__PURE__*/function (_Component) {
89
89
 
90
90
  _this.getRtlPositionX = function (x) {
91
91
  if (_this.props.rtl) {
92
- return _platform.platform.ios || _platform.platform.safari || _platform.platform.chrome >= 85 ? -x : _this.scrollBounds.maxLeft - x;
92
+ return _platform.platform.ios || _platform.platform.safari || _platform.platform.chrome >= 85 || _platform.platform.androidChrome >= 85 ? -x : _this.scrollBounds.maxLeft - x;
93
93
  }
94
94
 
95
95
  return x;
@@ -777,7 +777,7 @@ var VirtualListBaseFactory = function VirtualListBaseFactory(type) {
777
777
  }
778
778
 
779
779
  if (rtl) {
780
- x = _platform.platform.ios || _platform.platform.safari || _platform.platform.chrome >= 85 ? -x : this.scrollBounds.maxLeft - x;
780
+ x = _platform.platform.ios || _platform.platform.safari || _platform.platform.chrome >= 85 || _platform.platform.androidChrome >= 85 ? -x : this.scrollBounds.maxLeft - x;
781
781
  }
782
782
 
783
783
  this.containerRef.current.scrollTo(x, y);
@@ -840,7 +840,7 @@ var VirtualListBasic = /*#__PURE__*/function (_Component) {
840
840
 
841
841
  if (this.props.scrollContentRef.current && this.props.scrollContentRef.current.scrollTo) {
842
842
  if (rtl) {
843
- x = _platform.platform.ios || _platform.platform.safari || _platform.platform.chrome >= 85 ? -x : this.scrollBounds.maxLeft - x;
843
+ x = _platform.platform.ios || _platform.platform.safari || _platform.platform.chrome >= 85 || _platform.platform.androidChrome >= 85 ? -x : this.scrollBounds.maxLeft - x;
844
844
  }
845
845
 
846
846
  this.props.scrollContentRef.current.scrollTo(x, y);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enact/ui",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "description": "A collection of simplified unstyled cross-platform UI components for Enact",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -25,7 +25,7 @@
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
- "@enact/core": "^4.1.1",
28
+ "@enact/core": "^4.1.2",
29
29
  "classnames": "^2.2.5",
30
30
  "direction": "^1.0.1",
31
31
  "invariant": "^2.2.2",
@@ -866,7 +866,7 @@ var useScrollBase = function useScrollBase(props) {
866
866
  }
867
867
 
868
868
  if (rtl && canScrollH) {
869
- scrollLeft = _platform.platform.ios || _platform.platform.safari || _platform.platform.chrome >= 85 ? -scrollLeft : bounds.maxLeft - scrollLeft;
869
+ scrollLeft = _platform.platform.ios || _platform.platform.safari || _platform.platform.chrome >= 85 || _platform.platform.androidChrome >= 85 ? -scrollLeft : bounds.maxLeft - scrollLeft;
870
870
  }
871
871
 
872
872
  if (scrollLeft !== mutableRef.current.scrollLeft) {
@@ -1594,7 +1594,7 @@ var useScrollBase = function useScrollBase(props) {
1594
1594
  // Prevent scroll by focus.
1595
1595
  // VirtualList and VirtualGridList DO NOT receive `onscroll` event.
1596
1596
  // Only Scroller could get `onscroll` event.
1597
- if (!mutableRef.current.animator.isAnimating() && scrollContentHandle.current && scrollContentRef.current && scrollContentHandle.current.getRtlPositionX) {
1597
+ if (!mutableRef.current.animator.isAnimating() && scrollContentHandle.current && scrollContentRef.current && scrollContentHandle.current.getRtlPositionX && !mutableRef.current.isDragging) {
1598
1598
  // For Scroller
1599
1599
  scrollContentRef.current.scrollTop = mutableRef.current.scrollTop;
1600
1600
  scrollContentRef.current.scrollLeft = scrollContentHandle.current.getRtlPositionX(mutableRef.current.scrollLeft);