You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a dropdown configured with [usePopover]="true", popovers hide() is called twice whenever an item in the dropdown is clicked.
This has caused issues for consumers, that see errors like below for subsequent calls to hide(), when dropdown is already hidden:
uncaught error in micro frontend DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
at EmulatedEncapsulationDomRenderer2.removeChild (http://localhost:8783/default-node_modules_bankdata_relationsbank-sdk_fesm2015_bankdata-relationsbank-sdk-micro-fro-4d56c1.js:51308:20)
at PopoverComponent.hide (http://localhost:8783/default-node_modules_bankdata_relationsbank-sdk_fesm2015_bankdata-relationsbank-sdk-micro-fro-4d56c1.js:84125:23)
at PopoverComponent._backdropClick (http://localhost:8783/default-node_modules_bankdata_relationsbank-sdk_fesm2015_bankdata-relationsbank-sdk-micro-fro-4d56c1.js:84072:14)
at PopoverComponent_click_HostBindingHandler (http://localhost:8783/default-node_modules_bankdata_relationsbank-sdk_fesm2015_bankdata-relationsbank-sdk-micro-fro-4d56c1.js:84181:141)
Describe how to reproduce the bug
Check out repo, and edit a dropdown in the cookbook example to have [usePopover]="true".
debug with breakpoint on popovers hide() function or console.log something in the function.
See it being called twice, when an item within the dropdown is clicked.
Which Kirby version was used?
5.2.2
What was the expected behavior?
Only call hide() once, as the DOM is manipulated in the function, and elements might not be present on subsequent calls when the dropdown has been hidden.
Unfortunately, the HostListener is added as part of a very large commit, so not much history exist on why it was added. It does not seem to fire when clicking the backdrop(!) and generally the popover functionality seems to work without it, at least when used in a dropdown.
Would be interesting to investigate if the listener can be removed entirely, if it is leftover functionality accidentally left in the component.
Checklist:
The following tasks should be carried out in sequence in order to follow the process of contributing correctly.
Verification
To make sure the bug is not intended behaviour; it should be verified by a member of team Kirby before moving on to implementation.
Make sure the NOT verified label has been removed by a member of team Kirby; do not proceed until this is done
Implementation
The contributor who wants to implement this issue should:
The text was updated successfully, but these errors were encountered:
RasmusKjeldgaard
added
bug
NOT Prioritized
Issue not yet prioritized and added to a Milestone
NOT Verified
Applied to bug reports that have not been verified by a member of @kirbydesign/kirby-guild
and removed
NOT Prioritized
Issue not yet prioritized and added to a Milestone
NOT Verified
Applied to bug reports that have not been verified by a member of @kirbydesign/kirby-guild
labels
Apr 22, 2022
Describe the bug
For a dropdown configured with
[usePopover]="true"
, popovershide()
is called twice whenever an item in the dropdown is clicked.This has caused issues for consumers, that see errors like below for subsequent calls to hide(), when dropdown is already hidden:
Describe how to reproduce the bug
[usePopover]="true"
.hide()
function orconsole.log
something in the function.Which Kirby version was used?
5.2.2
What was the expected behavior?
Only call
hide()
once, as the DOM is manipulated in the function, and elements might not be present on subsequent calls when the dropdown has been hidden.Please complete the following information:
Are there any additional context?
The reason that the function is called twice, is that a backdrop click is also recorded, due to the hostlistener in popover:
51f8d12#diff-0f54fa478d78f29a82f9c3830d735d4c5de57f30cf649945ea9d7c51fc0d2db8R48-R52
Unfortunately, the HostListener is added as part of a very large commit, so not much history exist on why it was added. It does not seem to fire when clicking the backdrop(!) and generally the popover functionality seems to work without it, at least when used in a dropdown.
Would be interesting to investigate if the listener can be removed entirely, if it is leftover functionality accidentally left in the component.
Checklist:
The following tasks should be carried out in sequence in order to follow the process of contributing correctly.
Verification
To make sure the bug is not intended behaviour; it should be verified by a member of team Kirby before moving on to implementation.
NOT verified
label has been removed by a member of team Kirby; do not proceed until this is doneImplementation
The contributor who wants to implement this issue should:
Review
Once the issue has been implemented and is ready for review:
The text was updated successfully, but these errors were encountered: