No Code Attached Yet bug
avatar regularlabs
regularlabs
25 Aug 2021

Fields, like the ArticleField used in the Article menu item, open a modal to select the article.
However, on selecting/clearing the selection, the change event is not triggered on the hidden form field that contains the value.
This means you can't have custom javascript that triggers to the change event on those fields.

The solution is to add something like this to window.processModalParent in media/system/js/fields/modal-fields.js before the return.

fieldId.dispatchEvent(new Event('change'));
fieldTitle.dispatchEvent(new Event('change'));

image

avatar regularlabs regularlabs - open - 25 Aug 2021
avatar joomla-cms-bot joomla-cms-bot - change - 25 Aug 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Aug 2021
avatar RickR2H
RickR2H - comment - 25 Aug 2021

@regularlabs Could you make a PR? Happy to test if needed ;)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35372.

avatar regularlabs
regularlabs - comment - 25 Aug 2021

Nope. I am just reporting the issue. Not willing to make a PR. Do with it what you want.

avatar laoneo
laoneo - comment - 9 Nov 2021

#35994 ?

avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 22 Feb 2023
avatar regularlabs regularlabs - change - 2 Nov 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-11-02 08:15:11
Closed_By regularlabs
avatar regularlabs regularlabs - close - 2 Nov 2023

Add a Comment

Login with GitHub to post a comment