Using a selector containing a comma in "Apply Chosen to the following elements"
is impossible because the split is made directly looking for a comma.
e.g select:not([name*='field_to_exclude1'], [name*='field_to_exclude2']) would be split into
select:not([name*='field_to_exclude1']
[name*='field_to_exclude2'])
which are not valid selectors

CommentFileSizeAuthor
#2 3571919-1.patch1.49 KBvan.dordafog

Comments

van.dordafog created an issue. See original summary.

van.dordafog’s picture

StatusFileSize
new1.49 KB

one solution would be to make the selectors list split by new-line, existing would require adjustment

nagy.balint’s picture

This split was necessary to imitate the :visible selector not available in VanillaJS.

We can also likely change this split with a bit more complex code and avoid breaking compatibility.

something similar to

splitSelectors: function (selector) {
  const result = [];
  let current = '';
  let depth = 0;

  for (let i = 0; i < selector.length; i++) {
    const char = selector[i];

    if (char === '[' || char === '(') {
      depth++;
    }
    else if (char === ']' || char === ')') {
      depth = Math.max(depth - 1, 0);
    }

    if (char === ',' && depth === 0) {
      if (current.trim()) {
        result.push(current.trim());
      }
      current = '';
    }
    else {
      current += char;
    }
  }

  if (current.trim()) {
    result.push(current.trim());
  }

  return result;
},

  • nagy.balint committed 323a516b on 5.0.x
    feat: #3571919 Comma separated selectors list limits usability
    
    By: van....
nagy.balint’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.