cidgoh / DataHarmonizer

A standardized browser-based spreadsheet editor and validator that can be run offline and locally, and which includes templates for SARS-CoV-2 and Monkeypox sampling data. This project, created by the Centre for Infectious Disease Genomics and One Health (CIDGOH), at Simon Fraser University, is now an open-source collaboration with contributions from the National Microbiome Data Collaborative (NMDC), the LinkML development team, and others.
MIT License
91 stars 23 forks source link

Clear existing Jump To click handler before adding it #361

Closed pkalita-lbl closed 1 year ago

pkalita-lbl commented 1 year ago

jQuery's .on method appends new event handler methods to the target. This means that each time loadSelectedTemplate is called a new change handler (along with its closure) is appended to $jumpToInput. This causes handlers with stale columnCoordinates values to be called on change. The fix is to remove old handlers via the .off method before adding a new one.

Fixes #360

ddooley commented 1 year ago

Ah yes, I knew about appending of event listeners. So glad you caught this!