Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled state #181

Closed
emteknetnz opened this issue Jan 19, 2024 · 1 comment
Closed

Disabled state #181

emteknetnz opened this issue Jan 19, 2024 · 1 comment
Assignees

Comments

@emteknetnz
Copy link
Member

emteknetnz commented Jan 19, 2024

Need to support a disabled state which is set via ->setDisabled(true)

This is similar though not quite the same as ->setReadonly() which had supported on this card

For example, with very quick test locally shows that there is a mouse pointer with the readonly field, though there isn't one with the disabled field

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->insertAfter('Content', new TextField('MyText01'));
        $fields->insertAfter('Content', (new TextField('MyText02'))->setReadonly(true));
        $fields->insertAfter('Content', (new TextField('MyText03'))->setDisabled(true));
        return $fields;
    }   

Some differences between readonly and disabled can be found here

Acceptance criteria

  • When setDisabled is set to true, the field renders with the read only styles and the user can not update the value.
  • There's a follow up card to block any updates in the backend for readonly/disabled field.

Notes

  • We discussed whether disabled or readonly should have any practical difference. We concluded it wasn't really worth treating them as separate use cases.

PR

@sabina-talipova
Copy link
Contributor

PR is merged. Task is completed.

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

No branches or pull requests

3 participants