Modifier templates does not apply
- Dominant language
- JavaScript
- Stars
- 117
- Forks
- 48
- PR merge metrics
- No merged PRs in 30d
Description
### Input code or something about issue background
https://goo.gl/Xm3cWQ
```js
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
Contributor guide
Research direction
Start by reproducing the JavaScript snippet from the issue and tracing how modifier templates are processed relative to the default mode. The change is complete when the example produces 'YES' instead of 'NO' and the behavior is covered by an appropriate regression check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100