Skip to content
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

Modifier templates does not apply #482

Open
qfox opened this issue Oct 11, 2017 · 5 comments
Open

Modifier templates does not apply #482

qfox opened this issue Oct 11, 2017 · 5 comments

Comments

@qfox
Copy link
Member

qfox commented Oct 11, 2017

Input code or something about issue background

https://goo.gl/Xm3cWQ

block('a').def()('NO');
block('a').mods()({m: true});
block('a').mod('m').def()('YES');

Feels like it's too late but looks like a bug or useless sugar and we should fix that (modifier templates should apply).

Expected Behavior

'YES'

Actual Behavior

'NO'

Possible Solution

Apply mods/addMods BEFORE def mode?

Your Environment

latest bem-xjst

cc @Yeti-or @awinogradov

@miripiruni
Copy link
Contributor

miripiruni commented Oct 11, 2017

Today’s version bem-xjst have hierarchy of modes. def() mode is "first class" mode. The rest modes are "second class" modes. It means if a def() template has been defined other templates was not applied. It was done this way because users need full control. How is it suggested to control the templates in your case?

In your example https://goo.gl/Xm3cWQ you would get 'YES' if BEMJSON would be { block: 'a', mods: { m: true } }.

@qfox
Copy link
Member Author

qfox commented Oct 11, 2017

Yep, but we think this is wrong.

@sbmaxx
Copy link
Contributor

sbmaxx commented Oct 20, 2017

Any progress here?

@miripiruni
Copy link
Contributor

we think this is wrong

who are "we"?

@awinogradov
Copy link
Member

Look at the likes ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants