You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know that library not maintained anymore, but hope that some day author will fix the issue
Accidently I have discovered that in some cases Chrome and Firefox generate different optimal selectors for same element. After debugging I found the problem in findAttributesPattern function. The problem in the way Array.sort function works in different browsers.
0: class
1: data-css
class: class
data-css: data-css
length: 2
[[Prototype]]: NamedNodeMap
Object.keys(attributes) returns identical array ['0', '1'], but when sort callback function called in Chrome values are curr = '1', next = '0', but in Firefox curr = '0', next = '1'. So, at the end following logic:
I know that library not maintained anymore, but hope that some day author will fix the issue
Accidently I have discovered that in some cases Chrome and Firefox generate different optimal selectors for same element. After debugging I found the problem in
findAttributesPattern
function. The problem in the wayArray.sort
function works in different browsers.In my case in that line
optimal-select/src/match.js
Line 139 in 722d220
attributes
variable isObject.keys(attributes)
returns identical array['0', '1']
, but whensort
callback function called in Chrome values arecurr = '1', next = '0'
, but in Firefoxcurr = '0', next = '1'
. So, at the end following logic:works differently and
sortedKeys
in Chrome will be['1', '0']
, but in Firefox['0', '1']
.Additional information:
select
function called with default settings,priority
variable isThe text was updated successfully, but these errors were encountered: