Indicia-Team / media

Shared library of JavaScript code,
0 stars 2 forks source link

Event handler for editing taxa in addRowToGrid wrong when multiple grids #51

Closed JimBacon closed 1 year ago

JimBacon commented 1 year ago

IndiciaFns.addRowToGrid is called for each grid on a page and adds an event handler for the edit buttons each time. The selelctor is .edit-taxon-name which is not specific enough and applies to all edit buttons on all grids. The consequence is that

  1. On clicking an edit button, as many event handlers are called as there are grids on the page.
  2. The triumphant autocomplete that the user interacts with may reference the wrong species list.

The selector needs to specify the grid like #<gridId> .edit-taxon-name

This arises from https://github.com/BiologicalRecordsCentre/ABLE/issues/584