Backend readonly mode does not work for all widgets
Affected version(s)
4.9 & 4.13
Description
contao:
localconfig:
timeZone: 'Europe/Berlin'
timeZone is not displayed as readonly field.

defaultChmod is not displayes ad readonly.

This also applies to widgets in 4.9, not just 4.13.
see https://github.com/contao/contao/pull/4870
The following widgets do not (fully) support readonly => true:
checkboxcheckboxWizardchmodfileTreeimageSizeinputUnit(the select is not disabled)metaWizard(removing still works, but the add button is disabled)moduleWizardoptionWizardpageTreepickerradiosectionWizardselectwithchosen => truetableWizard(you can still add/delete rows and columns, but you cannot edit cells)timePeriod(the select is not disabled)trbl(the select is not disabled)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The following widgets do not (fully) support
readonly => true:
I just tried to fix this but found out that there is no readonly for many form inputs, MDN writes:
Only text controls can be made read-only, since for other controls (such as checkboxes and buttons) there is no useful distinction between being read-only and being disabled, so the readonly attribute does not apply.
We could implement the functionality ourselfs pretty easily with $this->readonly ? ' onclick="return false"' : '' but I’m not sure if this is needed.
If the input field does not support readonly, we do not have to, either, in my opinion.
Currently we half-support it for checkboxes, any change gets lost when saving, but the user can not see that directly.
I think we should either fully support it for all fields, or not support it for non-text fields (including the save mechanism).
shouldn't we simply convert readonly to disabled for checkboxes?
shouldn't we simply convert
readonlytodisabledfor checkboxes?
IMO no, readonly has a different meaning (the input field can still be focused for example)
shouldn't we simply convert
readonlytodisabledfor checkboxes?IMO no,
readonlyhas a different meaning (the input field can still be focused for example)
yes, for input fields that do support readonly. But for the ones that do not (like a checkbox), converting it to disabled would solve the issue?
But for the ones that do not (like a checkbox), converting it to
disabledwould solve the issue?
I don’t think so. disabled is just too different to me, as it would for example also not be sent by the browser anymore.
I think we should either fully support it for all fields, or not support it for non-text fields (including the save mechanism).
How can we fully support it for all fields if the HTML standard does not?
How can we fully support it for all fields if the HTML standard does not?
See https://github.com/contao/contao/issues/4868#issuecomment-1264333797 for checkboxes onclick="return false" should be sufficient.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.