Skip to content

Commit b5edc1e

Browse files
dedanadealisonjosephkennylam
authored
fix: remove loading animation in inlineloading inactive state (#17814)
* fix: remove loading animation in inlineloading inactive state * fix: remove loading animation in inlineloading inactive state- * fix: remove history files * Revert "fix: remove loading animation in inlineloading inactive state-" This reverts commit 5e7e769. * fix: add virtual studio code .history/* to gitignore * Update .gitignore --------- Co-authored-by: Alison Joseph <alison.joseph@us.ibm.com> Co-authored-by: Alison Joseph <alisonejoseph@Gmail.com> Co-authored-by: kennylam <909118+kennylam@users.noreply.github.com>
1 parent 02a8956 commit b5edc1e

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pids
3636
# Editor
3737
.DS_Store
3838
*.swp
39+
.history/*
3940
.idea
4041
.vscode
4142

@@ -65,4 +66,4 @@ blob-report
6566

6667
# nx local buiild cache
6768
.nx/cache
68-
.nx/workspace-data
69+
.nx/workspace-data

packages/react/src/components/InlineLoading/InlineLoading-test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ describe('InlineLoading', () => {
2424

2525
it('should render a loader if the status is inactive', () => {
2626
render(<InlineLoading status="inactive" />);
27-
28-
expect(screen.getByTitle('not loading')).toBeInTheDocument();
27+
expect(
28+
// eslint-disable-next-line testing-library/no-node-access
29+
document.querySelector('.cds--inline-loading__inactive-status')
30+
).toBeInTheDocument();
2931
});
3032

3133
it('should render the success state if status is finished', () => {

packages/react/src/components/InlineLoading/InlineLoading.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ const InlineLoading = ({
108108
</CheckmarkFilled>
109109
);
110110
}
111-
if (status === 'inactive' || status === 'active') {
111+
if (status === 'active') {
112112
if (!iconDescription) {
113-
iconLabel = status === 'active' ? 'loading' : 'not loading';
113+
iconLabel = 'loading';
114114
}
115115
return (
116116
<Loading
@@ -121,6 +121,16 @@ const InlineLoading = ({
121121
/>
122122
);
123123
}
124+
if (status === 'inactive') {
125+
if (!iconDescription) {
126+
iconLabel = 'not loading';
127+
}
128+
return (
129+
<title className={`${prefix}--inline-loading__inactive-status`}>
130+
{iconLabel}
131+
</title>
132+
);
133+
}
124134
return undefined;
125135
};
126136

0 commit comments

Comments
 (0)