webos3.x progressbar size
This commit is contained in:
28
com.twin.app.shoptime/patches/@enact+ui+3.5.0.patch
Normal file
28
com.twin.app.shoptime/patches/@enact+ui+3.5.0.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
diff --git a/node_modules/@enact/ui/useScroll/Scrollbar.js b/node_modules/@enact/ui/useScroll/Scrollbar.js
|
||||
index 12a810e..d228196 100644
|
||||
--- a/node_modules/@enact/ui/useScroll/Scrollbar.js
|
||||
+++ b/node_modules/@enact/ui/useScroll/Scrollbar.js
|
||||
@@ -128,8 +128,21 @@ var useScrollbar = function useScrollbar(props) {
|
||||
scrollbarThumbSizeRatioBase = scrollViewSize / scrollContentSize,
|
||||
scrollbarThumbProgressRatio = scrollOrigin / (scrollContentSize - scrollViewSize),
|
||||
scrollbarThumbSizeRatio = Math.max(_resolution["default"].scale(minThumbSize) / trackSize, Math.min(1, scrollbarThumbSizeRatioBase));
|
||||
- setCSSVariable(scrollbarTrackRef.current, '--scrollbar-thumb-size-ratio', scrollbarThumbSizeRatio);
|
||||
- setCSSVariable(scrollbarTrackRef.current, '--scrollbar-thumb-progress-ratio', scrollbarThumbProgressRatio);
|
||||
+ // setCSSVariable(scrollbarTrackRef.current, '--scrollbar-thumb-size-ratio', scrollbarThumbSizeRatio);
|
||||
+ // setCSSVariable(scrollbarTrackRef.current, '--scrollbar-thumb-progress-ratio', scrollbarThumbProgressRatio);
|
||||
+ //for old chrome version
|
||||
+ const thumb = scrollbarTrackRef.current?.childNodes?.[0];
|
||||
+ if(thumb){
|
||||
+ const thumbSize = (scrollbarThumbSizeRatio*100)+'%';
|
||||
+ const progress = ((1-scrollbarThumbSizeRatio) * scrollbarThumbProgressRatio)*100+'%';
|
||||
+ if(vertical){
|
||||
+ thumb.style.height = thumbSize;
|
||||
+ thumb.style.top = progress;
|
||||
+ }else{
|
||||
+ thumb.style.width = thumbSize;
|
||||
+ thumb.style.left = progress;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
if (scrollbarHandle) {
|
||||
Reference in New Issue
Block a user