Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2019-02-19 16:16:20 +0300
committerXhmikosR <xhmikosr@gmail.com>2019-02-20 23:05:45 +0300
commit1da5b9f76a05feae2663316247937aabda91d487 (patch)
tree72d15dc538604785992484625c43bee5470f7b97 /site/docs/4.3
parent7491b14f035753cd4564a6cfe87e943813ae0a17 (diff)
Add information about IE 11 compatibility.
Diffstat (limited to 'site/docs/4.3')
-rw-r--r--site/docs/4.3/getting-started/javascript.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/site/docs/4.3/getting-started/javascript.md b/site/docs/4.3/getting-started/javascript.md
index a509bd4826..ebe3842bea 100644
--- a/site/docs/4.3/getting-started/javascript.md
+++ b/site/docs/4.3/getting-started/javascript.md
@@ -209,3 +209,40 @@ $('#yourTooltip').tooltip({
}
})
{% endhighlight %}
+
+## Compatibility with IE 11
+
+Bootstrap v5 isn't designed to work with Internet Explorer 11, but you can add the following polyfills to make it work:
+
+{% highlight html %}
+<!-- Polyfill.io will load polyfills your browser needs -->
+<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js"></script>
+<script>
+ // Fix preventDefault for IE
+ (function () {
+ var workingDefaultPrevented = (function () {
+ var e = document.createEvent('CustomEvent')
+ e.initEvent('Bootstrap', true, true)
+ e.preventDefault()
+ return e.defaultPrevented
+ })()
+
+ if (!workingDefaultPrevented) {
+ var origPreventDefault = Event.prototype.preventDefault
+ Event.prototype.preventDefault = function () {
+ if (!this.cancelable) {
+ return
+ }
+
+ origPreventDefault.call(this)
+ Object.defineProperty(this, 'defaultPrevented', {
+ get: function () {
+ return true
+ },
+ configurable: true
+ })
+ }
+ }
+ })()
+</script>
+{% endhighlight %}