diff --git a/doric-js/bundle/doric-lib.es5.js b/doric-js/bundle/doric-lib.es5.js index 658f4d7f..bfb3a23a 100644 --- a/doric-js/bundle/doric-lib.es5.js +++ b/doric-js/bundle/doric-lib.es5.js @@ -425,6 +425,7 @@ var View = /** @class */ (function () { Object.defineProperty(View.prototype, "ref", { set: function (ref) { ref.current = this; + this._ref = ref; }, enumerable: false, configurable: true diff --git a/doric-js/bundle/doric-lib.js b/doric-js/bundle/doric-lib.js index 61948c7f..496c922b 100644 --- a/doric-js/bundle/doric-lib.js +++ b/doric-js/bundle/doric-lib.js @@ -345,6 +345,7 @@ class View { } set ref(ref) { ref.current = this; + this._ref = ref; } doAnimation(context, animation) { return this.nativeChannel(context, "doAnimation")(animation.toModel()).then((args) => { diff --git a/doric-js/bundle/doric-vm.js b/doric-js/bundle/doric-vm.js index bd0f8259..dfddfdd3 100644 --- a/doric-js/bundle/doric-vm.js +++ b/doric-js/bundle/doric-vm.js @@ -1875,6 +1875,7 @@ class View { } set ref(ref) { ref.current = this; + this._ref = ref; } doAnimation(context, animation) { return this.nativeChannel(context, "doAnimation")(animation.toModel()).then((args) => { diff --git a/doric-js/index.d.ts b/doric-js/index.d.ts index f2313554..fde1f399 100644 --- a/doric-js/index.d.ts +++ b/doric-js/index.d.ts @@ -648,6 +648,7 @@ declare module "doric" { flexConfig?: FlexConfig; set props(props: Partial); set parent(v: Group); + private _ref?; set ref(ref: Ref); doAnimation(context: BridgeContext, animation: IAnimation): Promise; clearAnimation(context: BridgeContext, animation: IAnimation): Promise; diff --git a/doric-js/lib/src/ui/view.d.ts b/doric-js/lib/src/ui/view.d.ts index 6651cbaa..4ca31021 100644 --- a/doric-js/lib/src/ui/view.d.ts +++ b/doric-js/lib/src/ui/view.d.ts @@ -135,6 +135,7 @@ export declare abstract class View implements Modeling { flexConfig?: FlexConfig; set props(props: Partial); set parent(v: Group); + private _ref?; set ref(ref: Ref); doAnimation(context: BridgeContext, animation: IAnimation): Promise; clearAnimation(context: BridgeContext, animation: IAnimation): Promise; diff --git a/doric-js/lib/src/ui/view.js b/doric-js/lib/src/ui/view.js index 0319d839..a4218db8 100644 --- a/doric-js/lib/src/ui/view.js +++ b/doric-js/lib/src/ui/view.js @@ -227,6 +227,7 @@ export class View { } set ref(ref) { ref.current = this; + this._ref = ref; } doAnimation(context, animation) { return this.nativeChannel(context, "doAnimation")(animation.toModel()).then((args) => { diff --git a/doric-js/src/ui/view.es5.ts b/doric-js/src/ui/view.es5.ts index 39e98ce1..72f56580 100644 --- a/doric-js/src/ui/view.es5.ts +++ b/doric-js/src/ui/view.es5.ts @@ -373,8 +373,11 @@ export abstract class View implements Modeling { this.in(v) } + private _ref?: Ref; + set ref(ref: Ref) { ref.current = this + this._ref = ref; } doAnimation(context: BridgeContext, animation: IAnimation) { diff --git a/doric-js/src/ui/view.ts b/doric-js/src/ui/view.ts index f2e55b8c..4349ebc9 100644 --- a/doric-js/src/ui/view.ts +++ b/doric-js/src/ui/view.ts @@ -382,8 +382,11 @@ export abstract class View implements Modeling { this.in(v) } + private _ref?: Ref; + set ref(ref: Ref) { ref.current = this + this._ref = ref; } doAnimation(context: BridgeContext, animation: IAnimation) {