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

Modals sometimes won't open (rather they open and immediately close) #72

Closed
MoshiKoi opened this issue Sep 14, 2022 · 1 comment · Fixed by #73
Closed

Modals sometimes won't open (rather they open and immediately close) #72

MoshiKoi opened this issue Sep 14, 2022 · 1 comment · Fixed by #73
Labels
area: components Changes to design components type: bug Something isn't working

Comments

@MoshiKoi
Copy link
Member

MoshiKoi commented Sep 14, 2022

Sometimes modals don't seem to open when their trigger is click on. This is due to the following lines in the handler for clicking outside the modal:

if (parentSlide !== this.refersToElement && this.slideTriggerNode !== target) {
this.closeSlide();
}

if(parentDropdown !== this.refersToElement && this.panelTriggerNode !== target) {
this.closeDropPanel();
}

Note the check for this.panelTriggerNode !== target. Consider the following layout:

<trigger element>
  <sub element>
<trigger element>
<modal popout element>

When <sub element> is clicked on, the modal is opened. However, since the trigger is outside the modal, the closeXOnClickOutside handler is also called - and since sub element !== trigger element, it immediately closes the modal again

The solution for both modal types is to replace _this.XTriggerNode !== target with !this.XTriggerNode.contains(target).

@cellio
Copy link
Member

cellio commented Dec 25, 2022

Has this change been propagated to qpixel yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: components Changes to design components type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants