mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-21 09:39:34 +00:00
Do not change the dropdownParent of tomselect if it is inside a modal
This ensures that it is properly displayed. Fixes issue #1073
This commit is contained in:
parent
1c8ca6c0a2
commit
4c30cab7c1
7 changed files with 41 additions and 8 deletions
|
|
@ -10,13 +10,19 @@ export default class extends Controller {
|
|||
|
||||
connect() {
|
||||
|
||||
//Check if tomselect is inside an modal and do not attach the dropdown to body in that case (as it breaks the modal)
|
||||
let dropdownParent = "body";
|
||||
if (this.element.closest('.modal')) {
|
||||
dropdownParent = null
|
||||
}
|
||||
|
||||
let settings = {
|
||||
allowEmptyOption: true,
|
||||
plugins: ['dropdown_input'],
|
||||
searchField: ["name", "description", "category", "footprint"],
|
||||
valueField: "id",
|
||||
labelField: "name",
|
||||
dropdownParent: 'body',
|
||||
dropdownParent: dropdownParent,
|
||||
preload: "focus",
|
||||
render: {
|
||||
item: (data, escape) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue