Closed chimit closed 2 years ago
Expected behaviour for readonly()
, see previously closed issue.
Expected behaviour for
readonly()
, see previously closed issue.
This issue should be reopened. Since readonly don't mean that the field must be disabled. This is the main difference between using disabled and readonly. readonly will append the value to the form data, but disabled will not append the value to the form data.
The Boolean readonly attribute, when present, makes the element not mutable, meaning the user can not edit the control.
then,
The difference between [disabled](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled) and readonly is that read-only controls can still function and are still focusable, whereas disabled controls can not receive focus and are not submitted with the form and generally do not function as controls until they are enabled.
How this should be the expected behaviour?
Description:
When I use the
readonly()
method I getreadonly disabled
attributes added into my input. The problem is that I don't want to disable the field. I just want to make it not editable manually.Detailed steps to reproduce the issue on a fresh Nova installation:
I'm using
dependsOn
to set a default value to the calculated final amount field. Everything works well until I submit the form. Theamount
field can't benull
. It's due to the HTML specific when the input field value is not sent when it has adisabled
attribute. I don't expect this attribute to be added when use thereadonly()
method. Probably, they should be split into two different methods for more granular control:readonly()
anddisabled()
: