Property names that clash with array methods produce unexpected results
Hi @LeaVerou,
I am not sure exactly whether it's a bug or not, but in my testcase if doesn't work as it should in the mv-action attribute inside collections. Will you please have a look at my example here?
Actually, it looks like it's a bug with the name "shift": it collides with the special property $shift about whether the Shift key was pressed, even though the property should have priority. If I change it to "shift2" then it seems to work.
Could you please confirm so I can edit the bug accordingly?
(Btw I'm travelling and will be back on Wednesday, so that's the earliest I can properly look into it)
Shame on me. I didn't even think about it. 😢 Yep, I changed the name of the property, and everything worked as it should.
Thanks, Lea! Have a nice journey! 😃
Actually it's a different clash: shift seems to clash with the array shift() method!
We had a similar problem with our filter() function clashing with the Array#filter() method, but the way we solved it was specific to functions, which is why it's not helping here...
Reduced testcase: https://codepen.io/leaverou/pen/pXxxvO?&editors=1100#0
Interestingly, the bug only happens when there is an actual property with that name, otherwise it (correctly) just prints "unshift".