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

Context menu: Shared menu breaks if a datagrid is present on the page #5818

Closed
volante007 opened this issue Nov 4, 2021 · 2 comments · Fixed by #5897
Closed

Context menu: Shared menu breaks if a datagrid is present on the page #5818

volante007 opened this issue Nov 4, 2021 · 2 comments · Fixed by #5897

Comments

@volante007
Copy link

volante007 commented Nov 4, 2021

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)

  1. Edit the context-menu/context-menu-shared.demo.html in enterprise-ng samples to simply include a datagrid (doesn't need any data or anything, just created)
    <div soho-datagrid></div>
  2. Click the "Destroy Input Popup" button
  3. Right click the text area
    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:

const otherTriggers = $(`[aria-controls="${menuId}"]`).not(this.element);
 // Needs to check to unwrap and wrap the menu in datagrid
const datagridFilterWrapper = $('.datagrid-filter-wrapper');

if (!otherTriggers.length || datagridFilterWrapper.length > 0) {
      // Destroy, teardown etc. happens here
     ...
}

3c7ec20#diff-b06106137d1a69bd28f432d8c8b19dddc9714fea7df3462dbf570c09983197c0

So even if there are other triggers, destroy happens due to $('.datagrid-filter-wrapper') present.

Version

  • ids-enterprise: 4.56.0

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.

@tmcconechy tmcconechy added team: homepages Issues for the homepages team type: bug 🐛 [5] Velocity rating (Fibonacci) labels Nov 4, 2021
@tmcconechy tmcconechy added this to Triage in Enterprise (Next) Sprint Grooming via automation Nov 4, 2021
@tmcconechy tmcconechy added [3] Velocity rating (Fibonacci) priority: high and removed [5] Velocity rating (Fibonacci) labels Nov 18, 2021
@tmcconechy tmcconechy added this to To do in Enterprise 4.58.x (Nov 2021) Sprint via automation Nov 18, 2021
@tmcconechy
Copy link
Member

@ericangeles had to prioritize this one as well for T2V

@janahintal
Copy link
Contributor

QA Passed. Thanks! Will now move this to Done.

@janahintal janahintal moved this from Ready for QA (beta) to Done in Enterprise 4.58.x (Nov 2021) Sprint Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high team: homepages Issues for the homepages team type: bug 🐛 [3] Velocity rating (Fibonacci)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants