Problem/Motivation
https://git.drupalcode.org/project/advancedform/-/merge_requests/16#note...
From @xurizaemon:
A separate note, which may want to go into a separate issue unless you like to tackle it here.
The form description at /admin/config/advancedform/advancedformsettings says,
Rule selectors to hide inputs, eg
node-form:[#revision-information]will hide the revision information fieldset on node forms. One rule per line.
This is not quite correct. AFAICT it should recommend .node-form :[#edit-revision-information] or .node-form:[ #edit-revision-information ]:
- The correct selector for that example is
.node-form, or the CSS will look for a<node-form>element which doesn't exist. - The CSS generator requires a space to target fields within the form element, which is only generated if there's a space after the square bracket. If this is omitted, no fields will be hidden.
- The revision information element is now targeted with
#edit-revision-information!
This UX has always been confusing to me 😁 might be worth copying some examples from previous comment to README for clarity when we tackle that?
We could insert a space in this line ($selector . ' ' . $concatSelectors . ' {' . PHP_EOL;), does it feel likely anyone is depending on the current behaviour of not inserting a space? Two spaces would be harmless in a CSS selector ...
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork advancedform-3559701
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
ericgsmith commentedComment #4
ericgsmith commentedSo we can't auto add the space as the select-* classes depend on there being no space.
Comment #5
ericgsmith commented