-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
@@ -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 |
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.
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
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.
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
6385587
to
fce50b7
Compare
@@ -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; | |||
} | |||
|
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.
So unless I'm misunderstanding something, this was only a problem when somebody was using the searchbar without the loading indicator turned on?
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.
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
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.