coregis / cbf-programs-map-2023

Rebranding and other updates to the Raise Your Hand Texas Programs Map
GNU General Public License v3.0
0 stars 0 forks source link

Loading the map with a zoomed ESC selected fails to initialise TomSelect #35

Closed eldang closed 8 months ago

eldang commented 8 months ago

Repro steps:

  1. Load the map as normal, and zoom to an ESC
  2. Either click refresh or copy-paste the URL (e.g. http://localhost:2023/?districts=esc&zoomto=20&year=2023 - I found this while investigatign #34)
  3. The dropdowns for zooming to districts don't initialise properly, and the console reports Uncaught TypeError: document.getElementById(...).tomselect is undefined

I suspect there's a timing issue here, whereby the zoom to district functionality is trying to run before the dropdown is populated, and then trying to look up a value from the dropdown. It's odd that it seems to only affect ESDs, not school districts, though.