Skip to content

console(form): a lookup with dependsOn keeps its value when the parent changes — an invoice saves a contact from a different account #11631

Description

@objectstack-fleet

QA-source: objectstack-ai/objectstack#21784 · records-forms.cascading-multilevel-and-clear · acceptance[3]

A clause of records-forms.cascading-multilevel-and-clear fails in the ObjectStack 17.7 pre-release checklist run objectstack-ai/objectstack#21784 (framework subject 316be321e, console pin 2e818d0b51ec). An independent verifier (VF3, RUNNER rule 7) confirmed it: P2 (confirmed by code; runner reproduced live twice). It predates the 17.6.0 console pin 31971ff1e; no open duplicate was found. Owner: objectui.

Reproduction

  1. Open /_console/apps/com.example.showcase/showcase_invoice → New.
  2. Account → Northwind; Contact → "Prospect 18" (a Northwind contact). Candidate request GET /data/showcase_contact?filter=["account","=",{NW}] → 26 rows (correct).
  3. Switch Account to Contoso (pick directly, or remove the chip then pick).
  4. Status → Draft; Create.
  5. Expected: the contact clears on the account change. Actual: the chip stays; GET of the new invoice reads account:{Contoso id}, contact:{the Northwind contact}. With the account removed the field still shows "Prospect 18 · Select Account first".

Mechanism

  • packages/components/src/renderers/form/form.tsx:1982-2045 — the only cascade-clear effect skips every field whose type is not in CASCADE_OPTION_WIDGET_TYPES (:2004, no lookup member; app-shell/src/utils/paramToField.ts:200 says so) and requires static options (:2005-2006).
  • packages/fields/src/widgets/LookupField.tsx:640-654 only re-scopes the candidate query from dependentValues; its sole onChange(null) is the manual remove (:1012).
  • Fixture: examples/app-showcase/src/data/objects/invoice.object.ts:96 contact dependsOn: ['account']. The server reference gate checks existence only, so the client clear is the only guard. Predates 17.6.0 by code.

Done when

Changing (or clearing) a lookup's dependsOn parent clears a selection that no longer satisfies the dependent filter.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:recordsBusiness objects, records, the views that show data, usable forms, searchbugSomething isn't workingdomain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions