fragment
fragment copied to clipboard
Triggers for Keyboard and MIDI not saving `key` param in local storage
Hi @raphaelameaume! First, congrats on the awesome work done to build this tool! 👏
I've noticed that the triggers for Keyboard and MIDI using the UI are not working.
The key
param doesn't seem to be persisted in the local storage as you can see on the screenshot below.
Thanks for your help!
Thanks for the kind words Fabien, and the reporting of this issue.
Indeed, there was a mixed-up between the custom and native events firing from <Input.svelte>. In this case, the callback to register the trigger expects a custom event and receive a native one, being unable to split the keys properly before saving to localStorage.
Considering <TextInput>
is only used in <Params>
and <FieldTrigger>
, I think we can safely dispatch a CustomEvent from Input.svelte
to mimic the behaviour of the on:change
callback.
But this gets me thinking into having both CustomEvent and the native one. Currently the on:change event is overridden in order to align every kind of input and being able to apply those change to whatever props we pass through from the sketch file. If we change this behaviour to keep the native one and dispatch a more "custom" one (so with a different name), this would have more consequences overall but maybe more future proof.
Will work on this for the next minor release
Thanks @raphaelameaume for the detailed explanation!
Solved in #21