Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when cycling the dropdown filter options in advanced search #11442 #11706

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions arches/app/media/js/bindings/select2-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ define([
var newOption = new Option(data.text, data.id, false, false);
// Append it to the select
$(el).append(newOption);
}
}
});
// maintain the current selection after adding new dropdown options
$(el).val(currentSelection).trigger('change');
Expand All @@ -92,13 +92,13 @@ define([

$(document).ready(function() {
$(el).selectWoo(select2Config);

if (value) {
value.extend({ rateLimit: 100 });
// initialize the dropdown with the value
$(el).val(value());
$(el).trigger('change.select2');
$(el).trigger('change.select2');

// update the dropdown if something else changes the value
const valueSubscription = value.subscribe(function(newVal) {
//console.log(newVal);
Expand All @@ -119,21 +119,18 @@ define([
},300);
});


$(el).on("change", function(e) {
let val = $(el).val();
if (val === "") {
val = null;
}
value(val);
});

$(el).on("select2:opening", function() {
if (select2Config.clickBubble) {
$(el).parent().trigger('click');
}
});

if (typeof select2Config.onSelect === 'function') {
$(el).on("select2:selecting", function(e) {
select2Config.onSelect(e.params.args.data);
Expand Down
1 change: 1 addition & 0 deletions releases/8.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Arches 8.0.0 Release Notes
- Make number datatype node values searchable in the main search [#11619](https://github.com/archesproject/arches/issues/11619)
- Prevent navigation to a new browser tab when clicking Manage link in index.htm [#11635](https://github.com/archesproject/arches/issues/11635)
- Add support for tile sort order to the bulk data manager [#11638](https://github.com/archesproject/arches/pull/11638)
- Fix issue that produced an error when cycling between the dropdown options in Advanced search [#11442](https://github.com/archesproject/arches/issues/11442)

### Dependency changes
```
Expand Down
Loading