Skip to content

Commit

Permalink
fix: animate rotation on radio button click
Browse files Browse the repository at this point in the history
  • Loading branch information
weaponsforge committed Oct 6, 2024
1 parent 827d134 commit fbcea4a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions public/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit fbcea4a

Please sign in to comment.