aboutsummaryrefslogtreecommitdiff
path: root/js/src/collapse.js
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2020-11-03 16:15:16 +0200
committerXhmikosR <[email protected]>2020-11-14 15:54:50 +0200
commiteaf616c6538847561cbfd60ce7fc54cea16d8a1b (patch)
tree2f85dca6dc5052317ed438310630253a5e34f137 /js/src/collapse.js
parent53ec604eb1bc8860128db832d8820f76531e1208 (diff)
downloadbootstrap-eaf616c6538847561cbfd60ce7fc54cea16d8a1b.tar.xz
bootstrap-eaf616c6538847561cbfd60ce7fc54cea16d8a1b.zip
Use `Array.find` instead of `Array.filter`
Diffstat (limited to 'js/src/collapse.js')
-rw-r--r--js/src/collapse.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/js/src/collapse.js b/js/src/collapse.js
index f3ca86f36..2ddcb0c04 100644
--- a/js/src/collapse.js
+++ b/js/src/collapse.js
@@ -150,8 +150,8 @@ class Collapse {
const container = SelectorEngine.findOne(this._selector)
if (actives) {
- const tempActiveData = actives.filter(elem => container !== elem)
- activesData = tempActiveData[0] ? Data.getData(tempActiveData[0], DATA_KEY) : null
+ const tempActiveData = actives.find(elem => container !== elem)
+ activesData = tempActiveData ? Data.getData(tempActiveData, DATA_KEY) : null
if (activesData && activesData._isTransitioning) {
return