Open geoffguillain opened 4 years ago
This issue has been marked as stale. This happened because:
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.
Is your feature request related to a problem? Please describe.
When comments are loaded asynchronously in a template, the Jetpack Comments module won't work for nested comments.
Jetpack Comments is enqueuing the
watch_comment_parent()
function/script incomment_form_before()
function using thewp_footer
action hook. Loading the comments asynchronously, thewp_footer
hook is already executed and no event listeners would be added. This is preventing the nested comments to work as thecomment_parent
hidden field won’t be updated.Describe the solution you'd like
I would like the JS in the
watch_comment_parent()
function to be accessible outside of the closure with any kind of hook/API that we could trigger for this async use caseDescribe alternatives you've considered
A workaround would be for the async comments to include this js snippet as well when the comments are loaded which is working but it sums up in mostly in copy-pasting the JS from
watch_comment_parent()
which is not elegant neither will be future proof if the Jetpack Comments feature evolves.Additional context
n/a