Recent searches
No recent searches
Modal contents are not populating when two (2) Zendesk tickets are open simultaneously
Posted Jul 13, 2023
Hi all,
Currently, I have a working modal that is triggered by a button using the onclick event. There are three (3) buttons that trigger the modal but each of them contains different data. The contents of the modal are from the divs which were populated using Handlebars from a JSON response when calling the API endpoint. The divs are using unique IDs.
While doing some tests, I noticed that when two (2) Zendesk tickets are open simultaneously, the Modal is no longer populated on the second ticket that was opened but it is still working on the first ticket that was opened. When I tried refreshing the page, the Modal works fine on the ticket that is active but no longers works on the ticket that is inactive.
Kindly check this Loom video to understand better what I meant.
Looking forward to your reply.
Thank you,
Benessa
0
5 comments
Christopher Kennedy
Which API's are you fetching the modal data from? Are you seeing a response from the endpoint on cases where the modal has no data?
Also, when are you fetching the modal data? Before the click and creation of the modal? On click/creation? From the modal itself after creation?
0
Benessa Dumol
Hi Christopher Kennedy, thank you for your response.
To answer your questions, it's a custom API that fetches the data of the Ivanti incident from Ivanti (third-party provider) and yes, I am seeing the response from calling the API endpoint. The API endpoint is called on the load of the ticket/app so the data are already in the div even before the modal is called.
Below are parts of the codes that are used for the modal:
1. Function to populate div with the data from the API response (on load of the ticket/app)
2. The div that contains the data
3. The button that is used to call the modal
4. The function that is called by the button
5. Below are the contents of modal.html
Let me know if you need anything to better understand my issue. Looking forward to your reply.
Thank you,
Benessa
0
Christopher Kennedy
I see you have a ticket open about this. I've taken over the ticket to work directly with you there.
1
Ned Petrov
Hi,
I'm experiencing the same issue. Unfortunately, the solution was not shared here.
I have a similar code and everything is working fine, and the modal is getting populated with the expected data, but once I move to a different opened ticket tab and open a modal, the window appears, but it remains empty.
This is the code I'm using to open the modal:
Ned
0
Ned Petrov
I managed to get it working somehow using the guide here:
https://developerblog.zendesk.com/making-modals-work-in-zaf-v2-251b7c940e58
Here are some snippets from my code as it might be useful to someone:
Ned
0