File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const DEFAULT_STYLES = {
20
20
21
21
const STYLES = {
22
22
INPUT : { overflow : "hidden" , whiteSpace : "nowrap" } ,
23
- TEXTAREA : { overflowY : "hidden" } ,
23
+ TEXTAREA : { overflow : "hidden" } ,
24
24
SELECT : { overflow : "hidden" , whiteSpace : "nowrap" } ,
25
25
OPTION : { overflow : "hidden" , whiteSpace : "nowrap" }
26
26
} ;
@@ -39,6 +39,14 @@ class Decoy {
39
39
return ;
40
40
}
41
41
const decoy = prepare ( dom . clone ( underlay , this . elementCache ) , underlay ) ;
42
+
43
+ // Specify only absolute side
44
+ decoy . style . width = `${ underlay . clientWidth } px` ;
45
+ decoy . style . height = `${ underlay . clientHeight } px` ;
46
+ decoy . style . removeProperty ( "min-width" ) ;
47
+ decoy . style . removeProperty ( "min-height" ) ;
48
+ decoy . style . removeProperty ( "max-width" ) ;
49
+ decoy . style . removeProperty ( "max-height" ) ;
42
50
document . body . appendChild ( decoy ) ;
43
51
decoy . scrollTop = underlay . scrollTop ;
44
52
decoy . scrollLeft = underlay . scrollLeft ;
Original file line number Diff line number Diff line change @@ -123,8 +123,6 @@ const clone = (orgElement, baseElement) => {
123
123
124
124
// Copy all styles
125
125
clonedElement . style . cssText = getComputedCssText ( orgElement ) ;
126
- clonedElement . scrollTop = orgElement . scrollTop ;
127
- clonedElement . scrollLeft = orgElement . scrollLeft ;
128
126
129
127
return clonedElement ;
130
128
} ;
You can’t perform that action at this time.
0 commit comments