Fix whitespace, thanks text editor... Also added an interdiff.
Follow-up patch that fixes restoring the original field after changes were made and discarded.
We should probably also add tests for "the label is displayed as expected after discarding changes".
I've added a test case for this and hope it makes sense. My approach is a bit different, I look for the .field__label
class (instead of both .field__label
and .field__item
) and add contenteditable="false"
to those. If such a label was found, the user cannot edit it, to hopefully prevent some confusion. Label contents are stripped from the saved value. If there's no dedicated label, everything stays the same as before.
The general problem is that we need some way to figure out what's the label and what's the actual value we want edited. This is however highly dependent on the theme :( So for now, you'd need to add that field__label
class to your templates.
Joachim Namyslo β credited ckaotik β .
quietone β credited ckaotik β .
smustgrave β credited ckaotik β .