Commit c09cfd40 authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Dispatch change event for updated input field

The RequestUpdate component, handling the
TCA "onChange" functionality, adds an event
listener to the main HTML field. In case of TCA
type "input", this field never dispatches such
event, because the user always changes the
"human readable" field in the GUI.

The main field is only updated manually by
FormEngine after validating the new value.
Therefore, the "onChange" property never
had any effect for TCA type "input" fields.

This is now fixed by dispatching a "change"
event for the main field after its value has
been updated.

Resolves: #93613
Releases: master, 11.5
Change-Id: I9facf3548619b3733975fb5c8f28622d03002e7b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72205

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Jochen's avatarJochen <rothjochen@gmail.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Jochen's avatarJochen <rothjochen@gmail.com>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent 37f059e1
Pipeline #19584 passed with stages
in 45 minutes and 40 seconds
......@@ -247,6 +247,9 @@ define([
}
$mainField.val(newValue);
// After updating the value of the main field, dispatch a "change" event to inform e.g. the "RequestUpdate"
// component, which always listens to the main field instead of the "human readable field", about it.
$mainField.get(0).dispatchEvent(new Event('change'));
$humanReadableField.val(formattedValue);
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment