ImageZoom: Fix when multiple images with carrousel (#2966)
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
This commit is contained in:
parent
e620431210
commit
a6ea03bacc
1 changed files with 10 additions and 0 deletions
|
@ -179,6 +179,11 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
match: /componentWillUnmount\(\){/,
|
match: /componentWillUnmount\(\){/,
|
||||||
replace: "$&$self.unMountMagnifier();"
|
replace: "$&$self.unMountMagnifier();"
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
match: /componentDidUpdate\(\i\){/,
|
||||||
|
replace: "$&$self.updateMagnifier(this);"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -215,6 +220,11 @@ export default definePlugin({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateMagnifier(instance) {
|
||||||
|
this.unMountMagnifier();
|
||||||
|
this.renderMagnifier(instance);
|
||||||
|
},
|
||||||
|
|
||||||
unMountMagnifier() {
|
unMountMagnifier() {
|
||||||
this.root?.unmount();
|
this.root?.unmount();
|
||||||
this.currentMagnifierElement = null;
|
this.currentMagnifierElement = null;
|
||||||
|
|
Loading…
Reference in a new issue