don't hide select2 element if not neccessary (#179)
This commit is contained in:
@@ -505,9 +505,6 @@ function buildTreeFromBody() {
|
|||||||
const selectContainers = document.querySelectorAll(".select2-container");
|
const selectContainers = document.querySelectorAll(".select2-container");
|
||||||
|
|
||||||
selectContainers.forEach((element) => {
|
selectContainers.forEach((element) => {
|
||||||
// hide the select2 container
|
|
||||||
element.style.display = "none";
|
|
||||||
|
|
||||||
// search select in previous
|
// search select in previous
|
||||||
let _pre = element.previousElementSibling;
|
let _pre = element.previousElementSibling;
|
||||||
while (_pre) {
|
while (_pre) {
|
||||||
@@ -516,6 +513,8 @@ function buildTreeFromBody() {
|
|||||||
_pre.style.display === "none"
|
_pre.style.display === "none"
|
||||||
) {
|
) {
|
||||||
_pre.style.removeProperty("display");
|
_pre.style.removeProperty("display");
|
||||||
|
// only hide the select2 container when an alternative select found
|
||||||
|
element.style.display = "none";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_pre = _pre.previousElementSibling;
|
_pre = _pre.previousElementSibling;
|
||||||
@@ -529,6 +528,8 @@ function buildTreeFromBody() {
|
|||||||
_next.style.display === "none"
|
_next.style.display === "none"
|
||||||
) {
|
) {
|
||||||
_next.style.removeProperty("display");
|
_next.style.removeProperty("display");
|
||||||
|
// only hide the select2 container when an alternative select found
|
||||||
|
element.style.display = "none";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_next = _next.nextElementSibling;
|
_next = _next.nextElementSibling;
|
||||||
|
|||||||
Reference in New Issue
Block a user