Skip to content

Consider reverting "Make fields with const pre-fiiled and readonly"Β #4344

@MarekBodingerBA

Description

@MarekBodingerBA

Prerequisites

What theme are you using?

core

Version

5.22.0

Current Behavior

The recent implementation of prefilled, readonly fields for const values, introduced by #4326, has led to a regression impacting various use cases.

In my opinion, this change is a regression as it alters expected behaviors in forms where user interaction is required. There are legitimate scenarios where fields with const values should not be readonly, such as (see playground):

  • confirmation fields where users must manually enter a specific text,
  • agree to terms by interacting with a checkbox.

Attempting to override the prefilled value with default does not work as expected, further complicating form configuration. The implementation should not automatically control whether a field is readonly. Flexibility should be provided to developers to define this behavior based on the specific use case.

Expected Behavior

Developers should have the option to configure whether a const field is prefilled and readonly or requires user input.

Steps To Reproduce

  1. Open the playground.

Environment

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions