contao icon indicating copy to clipboard operation
contao copied to clipboard

Backend readonly mode does not work for all widgets

Open netzarbeiter opened this issue 3 years ago • 7 comments

Affected version(s)

4.9 & 4.13

Description

contao:
    localconfig:
        timeZone: 'Europe/Berlin'

timeZone is not displayed as readonly field.

bug

defaultChmod is not displayes ad readonly.

bug

netzarbeiter avatar Jun 23 '22 13:06 netzarbeiter

This also applies to widgets in 4.9, not just 4.13.

fritzmg avatar Jun 23 '22 14:06 fritzmg

see https://github.com/contao/contao/pull/4870

aschempp avatar Jun 24 '22 06:06 aschempp

The following widgets do not (fully) support readonly => true:

  • checkbox
  • checkboxWizard
  • chmod
  • fileTree
  • imageSize
  • inputUnit (the select is not disabled)
  • metaWizard (removing still works, but the add button is disabled)
  • moduleWizard
  • optionWizard
  • pageTree
  • picker
  • radio
  • sectionWizard
  • select with chosen => true
  • tableWizard (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)

fritzmg avatar Jun 24 '22 07:06 fritzmg

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.

stale[bot] avatar Sep 09 '22 00:09 stale[bot]

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.

ausi avatar Oct 01 '22 11:10 ausi

If the input field does not support readonly, we do not have to, either, in my opinion.

leofeyer avatar Oct 04 '22 14:10 leofeyer

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).

ausi avatar Oct 04 '22 16:10 ausi

shouldn't we simply convert readonly to disabled for checkboxes?

aschempp avatar Oct 27 '22 07:10 aschempp

shouldn't we simply convert readonly to disabled for checkboxes?

IMO no, readonly has a different meaning (the input field can still be focused for example)

ausi avatar Oct 27 '22 09:10 ausi

shouldn't we simply convert readonly to disabled for checkboxes?

IMO no, readonly has 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?

aschempp avatar Nov 01 '22 20:11 aschempp

But for the ones that do not (like a checkbox), converting it to disabled would 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).

ausi avatar Nov 03 '22 11:11 ausi

How can we fully support it for all fields if the HTML standard does not?

aschempp avatar Nov 06 '22 09:11 aschempp

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.

ausi avatar Nov 07 '22 15:11 ausi

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.

stale[bot] avatar Jan 07 '23 13:01 stale[bot]