Skip to content

Commit

Permalink
Add custom behavior to prevent focus on multiselect dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
perfectly-preserved-pie committed Nov 19, 2024
1 parent 542507a commit 90a0c30
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions assets/javascript/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
document.addEventListener('DOMContentLoaded', function() {
const multiSelectDropdown = document.querySelector('.mantine-MultiSelect-dropdown');
if (multiSelectDropdown) {
multiSelectDropdown.addEventListener('mousedown', function(event) {
// Prevent default focus behavior
event.preventDefault();
// Set focus to another element (e.g., body)
document.body.focus();
});
}
});
2 changes: 1 addition & 1 deletion pages/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def create_subtype_checklist(self):
id='subtype_checklist',
data=data,
value=initial_values,
searchable=False,
searchable=True,
nothingFoundMessage="No options found",
clearable=True,
style={"margin-bottom": "10px"},
Expand Down

0 comments on commit 90a0c30

Please sign in to comment.