-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in adding a new css rule with selectors #23
Comments
Hi @fgiannar var sm = editor.SelectorManager;
var sel1 = sm.add('myClass1');
var sel2 = sm.add('myClass2');
var selectors = [sel1, sel2];
var cssComposer = editor.CssComposer;
var rule = cssComposer.add(selectors, 'hover');
//...
// And inside the add()... when you are at 173 line:
var addedSelectors = rule.get('selectors').add(selectors);
/*
'addedSelectors' and 'selectors' are 2 different arrays but contain
the same instances of sel1 and sel2
*/ Do you have some use case inside the editor where I can catch some strange behaviour? |
No I'm afraid not. This occurred from a custom script of mine, where I had: If I replaced the line 173, as explained in my first comment above, the selector models had ids else they had the Probably my bad, I am closing it since it's not reproducible on your end. |
Hi @fgiannar I think I get it, |
Just an update, in case anyone else faces the same issue: Again thanks for your time. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
In css_composer/main.js line 173 (add):
rule.get('selectors').add(selectors);
returns selectors with empty ids..
instead
selectors.each(function(selector){ rule.get('selectors').add(selector); });
seems to work.
The text was updated successfully, but these errors were encountered: