Skip to content

Platform Step Input ignores the inherited readonly input #14704

Done

Description

@InnaAtanasova

Platform Step Input (fdp-number-step-input) inherits a readonly input fromBaseInput, but it has no effect. Setting [readonly]="true" does not prevent the user from changing the value — typing, ArrowUp/ArrowDown, and the increment/decrement step buttons all still work and mark the control dirty.

Read-only can currently only be achieved with [editable]="false", becausecanChangeValue is gated on editable (and disabled), not readonly. This is inconsistent with the other form controls, which use readonly.

Expected behavior

  • [readonly]="true" marks the control read-only: typing, arrow keys, and the step buttons are blocked and do not mark the control dirty.
  • Programmatic updates (setValue, patchValue, writeValue, reset) still work while read-only.
  • readonly and editable should be reconciled so the read-only state is consistent — ideally readonly becomes the primary API, aligned with the rest of the form controls.

Current behavior

  • canChangeValue → !(this.disabled || !this.editable) — it checks editable, not readonly.
  • The native input and read-only styling are driven by editable ([readonly]="!editable", [class.is-readonly]="!editable"), so the inherited readonly input is dead.

Steps to reproduce

  1. Set up an fdp-number-step-input with [readonly]="true" and a seeded value.
  2. Type a new value, press ArrowUp, or click the +/- buttons.
  3. The value changes and the control is marked dirty.

Notes

  • [editable]="false" works today and is the documented read-only approach; the goal of this issue is to make readonly work too (and align the two).
  • Decide whether editable should be kept as an alias/deprecated in favor of readonly to avoid a breaking change — this needs an API decision.
  • A read-only docs example exists on the Step Input docs page ("Read-only Number Step Input"), currently using [editable]="false".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions