I'm working on a custom theme that uses WordPress Customization API to let the user play with parts of the content of his website, basically the front-page which he can modify by adding/removing custom blocks such as latest posts, page children, etc. Blacks structure is collected and filled in an custom input.
Everything works fine except for saving, the Customizer seems to have some safety that blocks me from saving the input value: in order to save it, I need to manually trigger a Javascript 'keypress' event by selecting the input and pressing a key. If I don't, the submit button stays disabled.
By browsing through /wp-admin/js/customize-controls.js I manage to activate the submit button:
wp.customize.trigger('change')
But even though the saving thing is unlocked, it doesn't have any effect: the input value is not sent to admin_ajax.php and my data is not saved.
Any idea of how I could force the trigger on the Javascript API to save my data? I couldn't find detailed doc on the WP JS API, that could helped too if I missed it somewhere.