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

SohoSearchfield: Update generates new template element #1186

Closed
xqses opened this issue Nov 26, 2021 · 4 comments · Fixed by #1265
Closed

SohoSearchfield: Update generates new template element #1186

xqses opened this issue Nov 26, 2021 · 4 comments · Fixed by #1265
Assignees
Labels
type: bug 🐛 [3] Velocity rating (Fibonacci)

Comments

@xqses
Copy link

xqses commented Nov 26, 2021

Describe the bug
Linking to this issue. While implementing a workaround to select/deselect all categories in a searchfield, I noticed that the updated method on Soho Searchfields apparently (?) creates a new wrapper element in the template instead of updating the old one. See the screenshots below

To Reproduce
Steps to reproduce the behavior:

  1. Write a template that will have a button and a category searchfield
  2. Implement a method that runs on button click which calls the searchfield.updated method with new options, for example:

selectAll() { this.categories$.subscribe((cats) => { cats.map((cat) => cat.checked = true); this.searchfield.updated( {...this.searchfield.options, categories: cats) ); });
I've verified that this also happens if you just pass this.searchfield.options (and not a new object), or if you pass no new object at all.

  1. Go to the page and click the button
  2. Open the inspector to see the problem (new element is created).
  3. (For additional verification, place breakpoints before and after you run the updated method)

Expected behavior
The updated method should update the element, not create a new element.

Version

  • ids-enterprise-ng: ~10.9.0

Screenshots
Here's a step-by-step album:
https://imgur.com/a/Jz5tuD7

Platform

  • OS Version: Windows 10
  • Browser Name: Chrome,
  • Browser Version. Version 96.0.4664.45 (Official Build) (64-bit)

Additional context
This bug isn't strictly limited to implementing a select all button outside of the category dropdown, but occurs whenever the updated method is called. Hence, it's related to the linked issue but not caused by it.

@tmcconechy tmcconechy changed the title Soho Searchfield update generates new template element SohoSearchfield: Update generates new template element Nov 29, 2021
@tmcconechy tmcconechy added [3] Velocity rating (Fibonacci) type: bug 🐛 labels Nov 29, 2021
@xqses
Copy link
Author

xqses commented Feb 16, 2022

Hi, this still seems to be an issue.

Any idea when this might be fixed?

Thanks

@tmcconechy
Copy link
Member

We can move it up in the backlog. But re-reading this im not sure how to tackle it. Can you maybe add a way to reproduce this using stackblitz.

https://stackblitz.com/edit/ids-quick-start-1311

Specifically steps 1,2,3 are not clear. What kind of template? Where does the code go? Which page do i run?

Usually a good issue would be..

  1. Run this example
  2. Follow these steps

@xqses
Copy link
Author

xqses commented Feb 16, 2022

Thanks for responding Tim.

Well, it's not reproducible via Stackblitz. But with essentially the same code, it's reproducible for example in this IDS repro project
The bug definitely still exists in the environment we are building (PV2). I will try to get a Github Pages going for that repo tomorrow, but you could also just fork it and run ng serve.

(In case you do, just go to the Searchfield Updated tab, open the inspector and click the update button)

@jbrcna
Copy link

jbrcna commented Mar 29, 2022

@jbrcna jbrcna moved this from Ready for QA (beta) to Done in Enterprise 4.62.x (Mar 2022) Sprint Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 [3] Velocity rating (Fibonacci)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants