-
-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix binding to objects with more than one property #1542
Conversation
address unreachable code
window.getComputedStyle(elm).getPropertyValue('color'), | ||
); | ||
expect(color).toBe('rgb(25, 118, 210)'); | ||
await expect(page.getByText('-test2-')).toBeVisible(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is testing that even if sx
has a broken binding like {
the element still shows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, and that the app doesn't crash
Using a bisection, I have found this commit breaking the support for: function run() {
return "Not found"
}
run() real use casefunction run() {
if (getRepositoryDetails.data) {
return `Repository ID: ${getRepositoryDetails.data.id}`
} else {
return "Not found"
}
}
run() and const nonProductScopeLabels = ["support: commercial"]
nonProductScopeLabels real use caseconst nonProductScopeLabels = ["support: commercial"]
materialUI.rows
.concat(muix.rows)
.filter((issue) => {
const withoutNonProductScopeLabels = issue.labels.filter(
(label) => !nonProductScopeLabels.includes(label.name)
)
return withoutNonProductScopeLabels.length === 1
})
.sort((issueA, issueB) => {
if (issueA.state === "open") {
return 1
}
if (issueB.state === "open") {
return 1
}
return issueB.number - issueA.number
}) in the binding. This was reported by Greg because https://master--toolpad.mui.com/_toolpad/app/cl6rqzry10009arlv9sto6qja/pages/ip23ggo throws (my previous link gets redirected to a wrong URL but this is a different bug) |
🤔 hmm, this was always intended to only support javascript expressions. i.e. anything that can go the the right side of an assigment. Otherwise it gets a bit ambiguous to define which kind of code it accepts exactly. But you should be able to (() => {
if (getRepositoryDetails.data) {
return `Repository ID: ${getRepositoryDetails.data.id}`
} else {
return "Not found"
}
})() and (() => {
const nonProductScopeLabels = ["support: commercial"]
return materialUI.rows
.concat(muix.rows)
.filter((issue) => {
const withoutNonProductScopeLabels = issue.labels.filter(
(label) => !nonProductScopeLabels.includes(label.name)
)
return withoutNonProductScopeLabels.length === 1
})
.sort((issueA, issueB) => {
if (issueA.state === "open") {
return 1
}
if (issueB.state === "open") {
return 1
}
return issueB.number - issueA.number
})
})() Otherwise we need to take it back to the drawing board |
@Janpot Alright, thanks. |
Currently, adding a binding
{ a:1, b:2 }
breaks the evaluator as it is interpreting this as a code block instead of an expression. This PR fixes the runtime behavior. Also opening #1543 to deal with the editor