The function hideSelectionFromResult was tested against undefined as a property and not as a function
This commit is contained in:
parent
0f1372ce72
commit
c87615f14c
@ -2276,7 +2276,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
if (initial === true && selected >= 0) {
|
if (initial === true && selected >= 0) {
|
||||||
// By default, the selected item is displayed inside the result list from a single select
|
// By default, the selected item is displayed inside the result list from a single select
|
||||||
// User can provide an implementation for 'hideSelectionFromResult' and hide it
|
// User can provide an implementation for 'hideSelectionFromResult' and hide it
|
||||||
if(this.opts.hideSelectionFromResult !== undefined && selectedElm !== null) {
|
if(selectedElm !== null) {
|
||||||
if(this.opts.hideSelectionFromResult(selectedElm))
|
if(this.opts.hideSelectionFromResult(selectedElm))
|
||||||
selectedElm.addClass("select2-selected");
|
selectedElm.addClass("select2-selected");
|
||||||
}
|
}
|
||||||
@ -3008,7 +3008,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
// By default, the selected item is hidden from the result list inside a multi select
|
// By default, the selected item is hidden from the result list inside a multi select
|
||||||
// User can provide an implementation for 'hideSelectionFromResult' and allow the same
|
// User can provide an implementation for 'hideSelectionFromResult' and allow the same
|
||||||
// element to be selected multiple times.
|
// element to be selected multiple times.
|
||||||
if(self.opts.hideSelectionFromResult === undefined || self.opts.hideSelectionFromResult(choice)) {
|
if(self.opts.hideSelectionFromResult(choice) === undefined || self.opts.hideSelectionFromResult(choice)) {
|
||||||
choice.addClass("select2-selected");
|
choice.addClass("select2-selected");
|
||||||
// mark all children of the selected parent as selected
|
// mark all children of the selected parent as selected
|
||||||
choice.find(".select2-result-selectable").addClass("select2-selected");
|
choice.find(".select2-result-selectable").addClass("select2-selected");
|
||||||
|
Loading…
Reference in New Issue
Block a user