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

[4.0] Modal fields don't trigger change event on form field #35372

Closed
regularlabs opened this issue Aug 25, 2021 · 3 comments
Closed

[4.0] Modal fields don't trigger change event on form field #35372

regularlabs opened this issue Aug 25, 2021 · 3 comments

Comments

@regularlabs
Copy link
Contributor

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

@RickR2H
Copy link
Member

RickR2H commented Aug 25, 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.

@regularlabs
Copy link
Contributor Author

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

@laoneo
Copy link
Member

laoneo commented Nov 9, 2021

#35994 😏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants