fix: zoomin storyview should not remove CSS properties when element is already removed (#9686)

This commit is contained in:
Saq Imtiaz 2026-02-23 08:59:32 +01:00 committed by GitHub
parent 75c26b46c6
commit 49faefcca5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -212,8 +212,8 @@ ZoominListView.prototype.remove = function(widget) {
]);
setTimeout(function() {
$tw.utils.removeStyles(toWidgetDomNode, ["transformOrigin", "transform", "transition", "opacity", "zIndex"]);
removeElement();
}, duration);
setTimeout(removeElement,duration);
// Now the tiddler we're going back to
if(toWidgetDomNode) {
$tw.utils.setStyle(toWidgetDomNode,[

View file

@ -30,8 +30,10 @@ Remove style properties of an element
styleProperties: ordered array of string property names
*/
exports.removeStyles = function(element, styleProperties) {
for(var i=0; i<styleProperties.length; i++) {
element.style.removeProperty($tw.utils.convertStyleNameToPropertyName(styleProperties[i]));
if(element) {
for(var i=0; i<styleProperties.length; i++) {
element.style.removeProperty($tw.utils.convertStyleNameToPropertyName(styleProperties[i]));
}
}
};