We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
First of all, thank you for this plugin! I did not completely cotton up to the new API, yet but all in all it works great and is very flexible.
However I get an error when I try to prevent the dropdown from opening or closing,
uiSelectElement.one('select2:opening', function(e){ e.preventDefault(); });
Error : Uncaught TypeError: Cannot set property 'prevented' of undefined
Select2.prototype.trigger = function (name, args) { var actualTrigger = Select2.__super__.trigger; var preTriggerMap = { 'open': 'opening', 'close': 'closing', 'select': 'selecting', 'unselect': 'unselecting' }; if (name in preTriggerMap) { var preTriggerName = preTriggerMap[name]; var preTriggerArgs = { prevented: false, name: name, args: args }; actualTrigger.call(this, preTriggerName, preTriggerArgs); if (preTriggerArgs.prevented) { args.prevented = true; // this is where the error occurs return; } } actualTrigger.call(this, name, args); };
Line 5161 (I´m using version 4.0)
It seems like there are no arguments passed when triggering the open / close events.
Thanks in advance, Jesse
The text was updated successfully, but these errors were encountered:
Part of the issue here is that we do not provide in a blank object ({}) if one wasn't passed in originally.
{}
Sorry, something went wrong.
7166935
@kevin-brown Is it possible to release all the current fixes as 4.0.1 and move the open issues to 4.0.2?
For anyone still on Select 4.0.0, you could alternatively use CSS to disable opening/closing Select2:
.select2-selection { border-radius: 4px !important; pointer-events: none; } .select2-selection__choice__remove { pointer-events: visible; } .select2-dropdown--below { display: none; }
Super hacky but it works, all browsers and IE11+
No branches or pull requests
First of all, thank you for this plugin! I did not completely cotton up to the new API, yet but all in all it works great and is very flexible.
However I get an error when I try to prevent the dropdown from opening or closing,
Error : Uncaught TypeError: Cannot set property 'prevented' of undefined
Line 5161 (I´m using version 4.0)
It seems like there are no arguments passed when triggering the open / close events.
Thanks in advance,
Jesse
The text was updated successfully, but these errors were encountered: