Bumping this thread because I’m having the same issue in 8.1. I can’t get any onComposition events to fire. Are these events intended to fire when the user changes the value of a text field?
Using a change script is not ideal in my situation because I only want the script to execute when the value is changed from the text field (not other sources).
First things first:
The onCompositionXXX Events are used to accommodate languages which do not use “latin” characters, so don’t expect these events to help you in this situation.
After wracking my brain trying to find a way to manage this and thinking there must be an easy way, I reached out to Dev and was reminded that there IS INDEED AN EASY WAY.
In the onChange script, specify that you only take an action if the origin is the browser:
if origin == 'Browser':
# update database
This will result in the update only taking place if the “user” has changed the value, as opposed to a “Binding” or “Script”.
Wanted to bump this, since I'm running into the same frustrations with a Dropdown component. Since the Dropdown also has the ability to enter custom text (if allowCustomOptions is enabled), I thought I'd be able to use the onCompositionEnd event if the user manually enters text to open a popup for her/him to confirm whether to add the new value to the database.
The proposed solution to filter on:
isn't as straightforward for the Dropdown, since the props.value field would also be changed by the browser when a user selects an existing option. In this case, I also need to filter out numeric values and 'null', which is what is set after clearing. I'm sure this solution will work, but just seems like kind of a kludgy workaround.
Like @rberghammer, I'd recommend either clarifying this in the documentation or fixing it so the events fire as expected.
I’ll reach out to the documentation team, but to be clear: the Events do fire as expected - they’re just not being used as they are intended to be used.
The "change script" is accessed by right-clicking the property which might change and selecting "Add Change Script" from the context menu. "Change" scripts are not a component-interaction event, so they're in a different location.