From fbcea4af7e746e6b9fc0c90d21cf046aac336b7e Mon Sep 17 00:00:00 2001 From: weaponsforge Date: Sun, 6 Oct 2024 17:56:16 +0800 Subject: [PATCH] fix: animate rotation on radio button click --- public/viewer.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/viewer.js b/public/viewer.js index 76528f1..f2685c6 100644 --- a/public/viewer.js +++ b/public/viewer.js @@ -126,8 +126,12 @@ Viewer.prototype.onWindowResize = function() { Viewer.prototype.onClick = function(e) { const { target } = e - // Skip processing radio button clicks - if (target?.tagName === 'INPUT' && target?.type === 'radio') return + // Skip processing radio button clicks if anim is running + if ( + target?.tagName === 'INPUT' && + target?.type === 'radio' && + this.animationFrameId + ) return if (this.animationFrameId) { this.stopAnimation()