-
Notifications
You must be signed in to change notification settings - Fork 313
fix: fix switch case for inline loading not working #3163
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
base: next
Are you sure you want to change the base?
fix: fix switch case for inline loading not working #3163
Conversation
✅ Deploy Preview for carbon-angular-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for carbon-components-angular ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@switch (true) { | ||
@case (state === InlineLoadingState.Inactive || state === InlineLoadingState.Active) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably just use a @if/else if condition instead. If you want to continue to use switch case, you can create a template for the content of state === InlineLoadingState.Inactive || state === InlineLoadingState.Active
condition and use that condition for both case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, fair. I've switched to if else because it is less hidden than working that into a condition.
<div | ||
class="cds--loading cds--loading--small" | ||
[ngClass]="{ | ||
'cds--loading--stop': state === InlineLoadingState.Inactive | ||
'cds--loading--stop': state === InlineLoadingState.Inctive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'cds--loading--stop': state === InlineLoadingState.Inctive | |
'cds--loading--stop': state === InlineLoadingState.Inactive |
@switch(true) { | ||
@case(state === InlineLoadingState.Inactive || state === InlineLoadingState.Active) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
switch case compares the value in the case via === which does not work with || or &&
e218bc2
to
6125962
Compare
switch case compares the value in the case via === which does not work with || or &&
inline loading did not work since the switch case had some problems but it should be fixed now
Found it while doing visual tests for #3162
Changelog
Changed