Problem/Motivation
#2559877: [Regression] Quick editing a body field on Standard does not work has shown that quickedit relies quite a lot on the structure of the divs, which is problematic
as template could change quite a bit about them.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 2559955-4.patch | 1.24 KB | wim leers |
Comments
Comment #2
davidhernandezComment #3
mortendk commenteddunno if we should attach the issue that Quickedit now uses
.region-contentas a selector ? or seperate that into its own issue ?we bashed around that back in #2407739: Remove classes from system templates r*.html.twig where the issue came up the first time.
i would suggest we used a data-attribute instead for this functionality & attached it to the body or main, else were opening up for so many doors where we can break this :/
Comment #4
swentel commentedI think .quickedit-field should be fine. It's added by initializeField() in quickedit.js so even if there are no classes at all on a field, it should still work because the data-attribute is there (unless attributes aren't printed either, but that's shooting yourself in the foot then).
Comment #5
wim leersI did some thorough manual testing. The solution in #4 makes a ton of sense. Many thanks!
This is super important for making it possible to have custom themes in Drupal 8 still support Quick Edit without subtle, non-explicit restrictions. It will ensure #2178121: Document the requirements for themes for Quick Edit to work in/with them will result in very simple instructions/guidelines for theme developers in D8.
Comment #6
nod_Wouldn't we want at least a js- prefixed class name? or a data attribute?
Comment #7
wim leersRight, I forgot that that is the new rule.
Comment #8
wim leersComment #10
wim leersTestbot--
Comment #11
rainbowarrayCan we remove the gendering in this comment while we're at it. There has to be a better way to write this.
Wouldn't we want to change this to js-quickedit-field or a data attribute as nod_ suggested before we RTBC this?
Comment #12
wim leersOops, yes, I forgot about #7 in #10.
Wim--
Comment #13
yched commentedNice ! RTBC then ?
Comment #14
rainbowarrayI manually tested this, and it seems to work. But don't we need to change the template output to use js-quickedit-field as well? I'm only seeing quickedit-field in the template markup.
Comment #15
wim leers#14: this is 100% JS-only. That's the whole point: to make Quick Edit not rely on the template markup. This patch makes Quick Edit's JS rely solely on the already-existing
data-quickedit-*attributes, which cause this class to be added.Except that this patch actually is relying on the non-existent
.js-quickedit-fieldclass; QuickEdit's JS still creates thequickedit-fieldclass — seeinitializeField()inquickedit.js.Renaming that class is actually out of scope here, because it would require changes to Quick Edit's JS, which would then have inconsistent class names.
So, re-uploading the patch in #4.
Comment #16
nod_fair enough.
Comment #17
prestonso commentedNotwithstanding the CSS selectors in
quickedit.theme.css, which would break ifquickedit-fieldis renamedjs-quickedit-fieldininitializeField().Comment #18
effulgentsia commentedAdding credit to @mdrummond for manually testing this.
Comment #20
effulgentsia commentedPushed to 8.0.x.
Comment #22
wim leersActually, this caused a regression: #2671202: [regression] Text field's label is duplicated in the value when edited & saved using Quick Edit.