User tests: Successful: Unsuccessful:
The onchange event is not triggered on a form element when the element's value is updated programmatically, only on user input, therefore a "change" event must be dispatched when the user id field value is set.
Without dispatching a change event, the change event listener created for the data-onchange attribute is not triggered, and the associated function is not called.
Edit administrator/components/com_content/forms/article.xml and set an onchange attribute for the create_by field, eg:
<field
name="created_by"
type="user"
label="COM_CONTENT_FIELD_CREATED_BY_LABEL"
onchange="(function(){console.log('change')})()"
/>
Create or edit an article, and in the Options tab, select a new user for the Created By field.
In the browser console, "change" should be displayed when the new user is selected.
Nothing is displayed in the console as a change event is not triggered.
None.
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript |
Title |
|
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-07-31 11:12:07 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
Thankyou!
This PR, although merged into 4.0-dev, does appear to have been dropped at some stage.
I would imagine this may have happened when the files were moved from media/system/webcomponents/js/ to media/system/js/fields/
The issue still exists, as you can see here - https://github.com/joomla/joomla-cms/tree/4.0-dev/media/system/js/fields/joomla-field-user.js
@ryandemmer please create a new issue and refer to this one - already merged and closed issues rarely get noticed. Thanks
Done - #29404 - Thanks @brianteeman :)
Thank you @wilsonge !