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
|
@ -179,6 +179,11 @@ export default definePlugin({
|
|||
{
|
||||
match: /componentWillUnmount\(\){/,
|
||||
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() {
|
||||
this.root?.unmount();
|
||||
this.currentMagnifierElement = null;
|
||||
|
|
Loading…
Reference in a new issue