Commit 6b585021 authored by Johann-S's avatar Johann-S Committed by XhmikosR
Browse files

Second element of find and findOne should be optional, not the first one

parent b69fa9db
5 merge requests!31948Examples/Floating-labels: fix bad behavior with autofill,!30064test,!29779Responsive sizing,!28882fix custom-select-indicator in IE10,!28721Hot test
Showing with 4 additions and 4 deletions
+4 -4
...@@ -84,7 +84,7 @@ class Alert { ...@@ -84,7 +84,7 @@ class Alert {
let parent = false let parent = false
if (selector) { if (selector) {
parent = SelectorEngine.find(selector)[0] parent = SelectorEngine.findOne(selector)
} }
if (!parent) { if (!parent) {
......
...@@ -46,19 +46,19 @@ const SelectorEngine = { ...@@ -46,19 +46,19 @@ const SelectorEngine = {
return fnMatches.call(element, selector) return fnMatches.call(element, selector)
}, },
find(element = document, selector) { find(selector, element = document) {
if (typeof selector !== 'string') { if (typeof selector !== 'string') {
return null return null
} }
if (selector.indexOf('#') === 0) { if (selector.indexOf('#') === 0) {
return SelectorEngine.findOne(element, selector) return SelectorEngine.findOne(selector, element)
} }
return element.querySelectorAll(selector) return element.querySelectorAll(selector)
}, },
findOne(element = document, selector) { findOne(selector, element = document) {
if (typeof selector !== 'string') { if (typeof selector !== 'string') {
return null return null
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment