[WC-3501]: fix(combobox-web): fix inverted editability logic#2332
Conversation
This comment has been minimized.
This comment has been minimized.
aecac76 to
2351483
Compare
This comment has been minimized.
This comment has been minimized.
The `conditionally` branch returned `expression.value` directly, so a truthy value (meaning "editable") made the widget read-only, and vice versa. Fixed by returning `true` only when the expression is not `true`, and added unit tests for all `getReadonly` branches.
2351483 to
86b58b8
Compare
AI Code Review
What was reviewed
Skipped (out of scope): CI checks could not be retrieved — please verify all checks pass before merging. Findings
|
Summary
getReadonly()where theconditionallyeditability mode had inverted logic:expression.value = true(meaning "editable") was being returned directly as the read-only flag, making the widget read-only when it should be editable, and vice versa.targetAttributecaused the function to return early withfalse(editable), bypassing the custom editability condition entirely. NowtargetAttributeonly short-circuits when it is explicitly read-only.getReadonly.Root cause
Two issues in
getReadonly:targetAttributepresence meant any editable attribute would always report the widget as editable, ignoring theneverorconditionallysettings.conditionallybranch returnedcustomEditabilityExpression.value ?? truedirectly, where the expression represents editability (true = editable), so the boolean was inverted.