Bug #100026
open
Modal renders content twice
Added by Andreas Kienast over 1 year ago.
Updated 12 days ago.
Category:
Backend JavaScript
Description
It seems there is an issue regarding lifecycle events in the modal component. It's reproducible with any modal that loads its content by an AJAX request:
- Throttle the network connection in the browser, "Fast 3G" is fine
- Open said modal, e.g. "+ Content" in page module
The endpoint is requested twice, therefore the `modal-loaded` event is triggered twice. This is also an issue for fixing #100025 gracefully.
- Related to Bug #100025: Timing issues when rendering LiveSearch form added
- Category set to Backend JavaScript
- Status changed from New to Needs Feedback
At least in v13 I cannot seem to reproduce this (network set to "3G" and "2x CPU throttling"), can you say if it still applies?
I think this is still reproducible even on version 14 (latest main) with the following steps:
1. Open TYPO3 backend
2. Page module > go to a page
3. Open Chrome Dev Tools (I'm using Chrome)
4. Go to "Network Tab"
5. Select throttling "3G" or "Slow 4G"
6. Filter the network log table with "Fetch/XHR"
7. Clean up the network log
8. Click on the "New Content" button on one of the columns
Results:¶
on the network log table, you will see TWO rows beginning with "new?token....."
Please note that if you disable the throttling the issue does not occur.
The clipboard has a similar issue: https://forge.typo3.org/issues/97317, but while I just mention it, I think the solutions differ very much, so I stick to this bug only.
The advisable way is probably to work with a promise, and proceed when this is satisfied.
I'm not sure how this behaves in combination with Ajax though.
Also available in: Atom
PDF