Skip to content

Field Filters: operator dropdown (Is/Between/Less/More etc.) doesn't reflect a pre-populated value #472

Description

@ValeriaMaltseva

Affected Version

2026.2 (long-standing UI defect, newly reachable via #150's Grid Config filter restore)

Affected capability

Data Objects / Assets - Field Filters (listing sidebar filter panel)

Steps to reproduce

  1. Open a listing (e.g. Data Objects Children Grid) with an "operator + value" style Field Filter column available - ID, another numeric field, a date field, a time field, or a quantity-value field.
  2. Add a Field Filter for that column and set the operator to something other than the default (e.g. for a numeric/ID field: "More" instead of "Is").
  3. Get that filter re-applied to the row from already-set data instead of being freshly added - the reliable repro is: save a Grid Config template with this filter (requires Children Grid config with filter does not work properly #150's fix), then reload the page and reselect the template so the filter panel restores from the saved configuration.
  4. Look at the operator dropdown for that filter row.

Actual Behavior

The operator dropdown always shows the type's default option ("Is" for Number/ID/Quantity Value, "On" for Date/Time), regardless of the actual restored/underlying operator. The numeric/date value shown next to it is correct for the real operator, so the row looks internally inconsistent (e.g. value shown as if "More" was picked, but dropdown displays "Is").

Expected Behavior

The operator dropdown should always reflect the filter's actual current operator, including right after the row is created with a pre-existing value (e.g. restored from a saved Grid Config template).

Technical notes

Root cause: the operator Select in these field-filter components is uncontrolled - it's seeded once via defaultValue instead of being bound to the computed currentSetting via value, so it never re-syncs after the row's first mount. Affects (at least) these 4 components, which all share the identical pattern:

  • assets/js/src/core/modules/element/dynamic-types/definitions/field-filters/components/dynamic-type-field-filter-number-component.tsx (Number, and ID which reuses it)
  • assets/js/src/core/modules/element/dynamic-types/definitions/field-filters/components/dynamic-type-field-filter-date-component.tsx (Date)
  • assets/js/src/core/modules/element/dynamic-types/definitions/field-filters/components/dynamic-type-field-filter-time-component.tsx (Time)
  • assets/js/src/core/modules/element/dynamic-types/definitions/field-filters/components/dynamic-type-field-filter-quantity-value-component.tsx (Quantity Value)

Fix is the same one-line change in each: change the Select from defaultValue={DEFAULT_SETTING} to value={currentSetting}.

Found while working on #150.

Activity

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

Metadata

Metadata

Type

No type

Fields

Affected capability

None yet

Platform Version

None yet

Galaxy

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions