mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
fix hiding of "Add" input on comboboxes with fixed options
the check for this needs to be done after the available options are actually refreshed
This commit is contained in:
@@ -44,6 +44,7 @@ _Breaking developer changes, which may affect downstream projects or sites that
|
||||
#### :white_check_mark: Validation
|
||||
#### :bug: Bugfixes
|
||||
* Fix `multi/many/semiCombo` options for not being selectable immediately after removing them for fields with predefined options
|
||||
* Fix a bug where the _Add_ input element on comboboxes with a fixed set of allowed options is still hidden after an option of a previously "fully saturated" field is removed
|
||||
#### :earth_asia: Localization
|
||||
* Send `Accept-Language` header on Nominatim API calls ([#9501], thanks [@k-yle])
|
||||
* Add Address and Phone Format for India ([#9482], thanks [@biswajit-k])
|
||||
|
||||
+10
-11
@@ -325,6 +325,12 @@ export function uiFieldCombo(field, context) {
|
||||
|
||||
_container.selectAll('input')
|
||||
.attr('placeholder', ph);
|
||||
|
||||
// Hide 'Add' button if this field uses fixed set of
|
||||
// options and they're all currently used
|
||||
var hideAdd = (!_allowCustomValues && !values.length);
|
||||
_container.selectAll('.chiplist .input-wrap')
|
||||
.style('display', hideAdd ? 'none' : null);
|
||||
}
|
||||
|
||||
|
||||
@@ -610,20 +616,13 @@ export function uiFieldCombo(field, context) {
|
||||
// a negative maxlength doesn't make sense
|
||||
maxLength = Math.max(0, maxLength);
|
||||
|
||||
var allowDragAndDrop = _isSemi // only semiCombo values are ordered
|
||||
&& !Array.isArray(tags[field.key]);
|
||||
|
||||
// Exclude existing multikeys from combo options..
|
||||
var available = objectDifference(_comboData, _multiData);
|
||||
_combobox.data(available);
|
||||
|
||||
// Hide 'Add' button if this field uses fixed set of
|
||||
// options and they're all currently used,
|
||||
// or if the field is already at its character limit
|
||||
var hideAdd = (!_allowCustomValues && !available.length) || maxLength <= 0;
|
||||
// Hide 'Add' button if this field is already at its character limit
|
||||
var hideAdd = maxLength <= 0;
|
||||
_container.selectAll('.chiplist .input-wrap')
|
||||
.style('display', hideAdd ? 'none' : null);
|
||||
|
||||
var allowDragAndDrop = _isSemi // only semiCombo values are ordered
|
||||
&& !Array.isArray(tags[field.key]);
|
||||
|
||||
// Render chips
|
||||
var chips = _container.selectAll('.chip')
|
||||
|
||||
Reference in New Issue
Block a user