Skip to content

Commit 64a8264

Browse files
committed
h5: fix to restoring resize properties
* we were incorrectly restoring el properties in _cleanHelper() (found whiledebugging code) * added missing types
1 parent ed14ed1 commit 64a8264

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/h5/dd-resizable.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ export class DDResizable extends DDBaseImplement implements HTMLElementExtendOpt
3838
private temporalRect: Rect;
3939
/** @internal */
4040
private startEvent: MouseEvent;
41+
/** @internal value saved in the same order as _originStyleProp[] */
42+
private elOriginStyleVal: string[];
4143
/** @internal */
42-
private elOriginStyle;
43-
/** @internal */
44-
private parentOriginStylePosition;
44+
private parentOriginStylePosition: string;
4545
/** @internal */
4646
private static _originStyleProp = ['width', 'height', 'position', 'left', 'top', 'opacity', 'zIndex'];
4747

@@ -193,7 +193,7 @@ export class DDResizable extends DDBaseImplement implements HTMLElementExtendOpt
193193

194194
/** @internal */
195195
private _setupHelper(): DDResizable {
196-
this.elOriginStyle = DDResizable._originStyleProp.map(prop => this.el.style[prop]);
196+
this.elOriginStyleVal = DDResizable._originStyleProp.map(prop => this.el.style[prop]);
197197
this.parentOriginStylePosition = this.el.parentElement.style.position;
198198
if (window.getComputedStyle(this.el.parentElement).position.match(/static/)) {
199199
this.el.parentElement.style.position = 'relative';
@@ -206,8 +206,8 @@ export class DDResizable extends DDBaseImplement implements HTMLElementExtendOpt
206206

207207
/** @internal */
208208
private _cleanHelper(): DDResizable {
209-
DDResizable._originStyleProp.forEach(prop => {
210-
this.el.style[prop] = this.elOriginStyle[prop] || null;
209+
DDResizable._originStyleProp.forEach((prop, i) => {
210+
this.el.style[prop] = this.elOriginStyleVal[i] || null;
211211
});
212212
this.el.parentElement.style.position = this.parentOriginStylePosition || null;
213213
return this;

0 commit comments

Comments
 (0)