Context menu: Shared menu breaks if a datagrid is present on the page #5818
Labels
priority: high
team: homepages
Issues for the homepages team
type: bug 🐛
[3]
Velocity rating (Fibonacci)
Describe the bug
When a context menu (e.g. popupmenu control) is shared among multiple triggers, the menu breaks if one of the triggers is removed when there is a datagrid present on the page. This is a regression issue.
To Reproduce
I'm actually unable to reproduce this in the core controls, but we see this when using the ng components, so it should be reproducible there (I'm reporting it here rather than enterprise-ng since the cause is in the core control)
<div soho-datagrid></div>
Result: Popup not shown / popup not positioned correctly (we see both in certain scenarios)
Expected behavior
The shared menu should not be destroyed, since there are triggers left for it. A datagrid present on the page should not affect & destroy a completely different menu. This code in
popupmenu.teardown()
is what's causing the issue:3c7ec20#diff-b06106137d1a69bd28f432d8c8b19dddc9714fea7df3462dbf570c09983197c0
So even if there are other triggers, destroy happens due to $('.datagrid-filter-wrapper') present.
Version
Additional context
infor-design/enterprise-ng#987
We've previously reported a similar issue, where the shared menu got broken when removing a trigger, no matter what. The
otherTriggers
code was added to fix that, but now we see it again due to the added datagrid check.The text was updated successfully, but these errors were encountered: