lumapps / lumX

The first responsive front-end framework based on Angular & Google Material Design specifications
https://ui.lumapps.com
MIT License
1.96k stars 274 forks source link

fix(progress): change from ng-class to class ternary #596

Closed akinjide closed 6 years ago

akinjide commented 6 years ago
screen shot 2018-04-08 at 7 42 22 pm

Browsers Chromium v67.0.3387.0 Safari v11.0.2

The ScreenShot above shows div.progress-container--indeterminate class not activated. So I switched to using ?:operator, which activates ? 'determinate' : 'indeterminate' depending on the lx-value value, set as an attribute by the user.

screen shot 2018-04-08 at 8 02 02 pm

The ScreenShot above shows div.progress-container--indeterminate activated and running fine.

Note: Bug and Fixes on both browsers listed above.

clementprevot commented 6 years ago

This is a weird one. I don't see why the ng-class wouldn't be triggered by the value of lxValue while the ternary expression is. The only downside of the current ng-class is that when lxValue is 0, it would be indeterminate.

I'm not a big fan of using this type of expression in interpolation inside of classes instead of ng-class. Can you try by using :

ng-class="{ 'determinate': lxProgress.lxValue !== undefined, 'indeterminate'; lxProgress.lxValue === undefined }"

instead ?

clementprevot commented 6 years ago

Thanks for your contribution!