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

Disable loading icon when inactive #1502

Merged
merged 1 commit into from
Aug 4, 2021
Merged

Conversation

cea2aj
Copy link
Member

@cea2aj cea2aj commented Aug 3, 2021

Disable the loading icon when it is inactive in order to prevent the icon from flashing during transitions

Note: The search bar will still sometimes flash the very first time the icon is clicked because of a long tasks associated with creating the components and waiting for the autocomplete response, but that's a separate issue

J=SLAP-1473
TEST=manual

See that when the loading indicator is enabled, the icon will no longer flash when clicking on and off the search bar.

@coveralls
Copy link

coveralls commented Aug 3, 2021

Coverage Status

Coverage remained the same at 60.483% when pulling fce50b7 on dev/loading-icon-disable into b84e3ec on develop.

@@ -216,6 +216,11 @@ $searchbar-button-text-color-active: var(--yxt-searchbar-button-text-color-base)
transform-origin: 50% 50%;
animation: dash 1.4s ease-in-out infinite;
}

&-Icon--inactive &-LoadingIndicator-AnimatedIcon
Copy link
Contributor

@yen-tt yen-tt Aug 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you just remove line 187-192 (which was used to keep the animation running while not on display), the display: none should work on the loading indicator without additional scss

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we keep the PR as-is, the starting position of the animation will actually change as if the animation was running the whole time. If we delete those lines then the loading icon will always start from the same spot

@@ -216,6 +216,11 @@ $searchbar-button-text-color-active: var(--yxt-searchbar-button-text-color-base)
transform-origin: 50% 50%;
animation: dash 1.4s ease-in-out infinite;
}

Copy link
Contributor

@oshi97 oshi97 Aug 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So unless I'm misunderstanding something, this was only a problem when somebody was using the searchbar without the loading indicator turned on?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem occurs when the icon transitions while the loading indicator animation is running. Since the loading indicator was always running in the background, this was always happening. By setting the animated icon to display: none while it is inactive, it is no longer possible for the loading indicator to be running while the icon is transitioning from the magnifying glass to the yext logo

@cea2aj cea2aj merged commit 3eb3335 into develop Aug 4, 2021
@cea2aj cea2aj deleted the dev/loading-icon-disable branch August 4, 2021 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants