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
In both cases the bracket notation does not match the regexp for dot.
Replacing the expression match part with (expression.match(/\./) || expression.match(/\[/)) does the trick.
(nb.: Tried creating a PR with fix and tests but couldn't for the life of me get Cypress running, kept failing with "require is not defined" and ultimately had to give up. If anyone has a hint, I'll gladly give it another go.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
When using bracket notation instead of dot notation the "undefined" test fails in x-bind and x-model.
Example:
The first input will show "undefined" where as the second will show an empty string.
Issue is caused by this line in x-bind:
alpine/packages/alpinejs/src/directives/x-bind.js
Line 17 in 68094c1
and this line in x-model:
alpine/packages/alpinejs/src/directives/x-model.js
Line 33 in 68094c1
In both cases the bracket notation does not match the regexp for dot.
Replacing the expression match part with
(expression.match(/\./) || expression.match(/\[/))
does the trick.(nb.: Tried creating a PR with fix and tests but couldn't for the life of me get Cypress running, kept failing with "require is not defined" and ultimately had to give up. If anyone has a hint, I'll gladly give it another go.)
Beta Was this translation helpful? Give feedback.
All reactions