-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix Brand Recommendations animation on second time appearance #1267
Fix Brand Recommendations animation on second time appearance #1267
Conversation
packages/x-components/src/x-modules/queries-preview/components/query-preview.vue
Outdated
Show resolved
Hide resolved
Hi @herrardo & @CachedaCodes here is another approach that makes more sense. Updated PR description 👀 . Let me know what you think, please. |
packages/x-components/src/x-modules/queries-preview/store/module.ts
Outdated
Show resolved
Hide resolved
packages/x-components/src/x-modules/queries-preview/components/query-preview.vue
Outdated
Show resolved
Hide resolved
… event, so we need all single queries to be deleted EMP-1707
/** | ||
* The component that shows a Query preview has been destroyed. | ||
*/ | ||
QueriesPreviewDestroyedHook: void; |
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.
Remove this event
@@ -49,6 +47,7 @@ | |||
import { createOrigin } from '../../../utils/origin'; | |||
import { debounce } from '../../../utils/debounce'; | |||
import { DebouncedFunction } from '../../../utils'; | |||
import { LIST_ITEMS_KEY, XProvide } from '../../../components'; |
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.
restore this imports as they were before
EMP-1707
Pull request template
Remove all the
QueriesPreview
from the state when the component is destroyed. This way, we prevent re-rendering effects when we go back to a pre-search scenario after selecting & removing a query from the search box.There were other two options available to handle this: using
v-show
instead ofv-if
, or preventing sending the requests if there wereQueryPreviews
on the state. These options had the con of losing the DOM animation, so I went for this removing queries approach from the state option in order to keep the current component rendering behavior.Motivation and context
When writing a query and then deleting it, the BrandRecommendations/QueryPreview component is displayed again, making like two times the appearance animation.
Type of change
What is the destination branch of this PR?
Main
How has this been tested?
"install:local": "npm install file:../x/packages/x-components/empathyco-x-components-3.0.0-alpha.406.tgz --no-save",