Don't instantiate so many comboboxes #5568
Labels
bug
A bug - let's fix this!
field
An issue with a field in the user interface
performance
Optimizing for speed and efficiency
A thing I found while working on #5558.
Every time we call
d3_combobox()
it makes a new one. This is ok to do when we want a new one, but really unnecessary when called on a d3 update selection (rerender).iD/modules/ui/fields/localized.js
Lines 142 to 146 in f8f5b69
This is a problem for 2 reasons:
_
to the front of variables that are state or act like state):iD/modules/lib/d3.combobox.js
Lines 16 to 22 in f8f5b69
And the reason that is a problem is because the
_suggestions
that have already been fetched go away.So, if you have ever noticed that when using a combobox, you type in the field, you can no longer use the up/down arrows to navigate the combobox options - this is why. The suggestions don't come back until you do something that causes the
fetcher
to run again.To fix this, I need to review all the places we use combo boxes in fields. I think that the main combobox field is ok, but the localized ones and the address ones and several others are not.
The text was updated successfully, but these errors were encountered: