Hi,
specifically stopPropagationAndPreventDefault() (not allowed this in the title?)
Using the latest version of business pack 4.2.0 and when clicking a switch button the js has an exception calling stopPropagationAndPreventDefault() which doesnt exist.
The file in question is:
bp–SwitchButton
specific code block
var d = k(l(), 1)
, o = class extends d.ButtonBase {
initialize() {
super.initialize(),
this.$element.click(t=>this.onElementClick(t)),
this.subscribe(this.binding.checked, this.onCheckedChange)
}
onElementClick(t) {
let {checked: e} = this.binding;
this.isEnabled && (t.stopPropagationAndPreventDefault(),
ko.isWriteableObservable(e) && e(!e()),
this.postback(this.binding.click))
}
onCheckedChange(t) {
this.$element.toggleClass(d.BusinessPackCss.stateChecked, t)
}
}
using asp (not core)
How to fix this, I have reinstalled and reverted to earlier version (4.13) but still the same
Current workaround is to include below in dotmaster
<dot:InlineScript>
$.Event.prototype.stopPropagationAndPreventDefault || ($.Event.prototype.stopPropagationAndPreventDefault = function () {
this.stopPropagation(),
this.preventDefault()
});
</dot:InlineScript>