-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form.Checkbox onChange provides weird value #1633
Comments
Since the initial value for the checkbox is anyway false, so, I don't see a reason to provide a false To make callbacks work more predictable we made it all work consistently. Some items can be updated initially on the native side. For example, the dropdown preselects the first available item. Or if an item has What about issue you mentioned, @sxn could you please take a look at that? |
Hey @mattisssa. What you say is true. My issue is that I don't use |
Ah, alright, that we will have a look at 👍 |
hey @maxfahl - thanks for the report! You're right: in some cases, the wrong input's value can be sent to another one's
with
A bit less convenient, but should unblock you in the mean time. 😓 |
Thank you @sxn! You mean removing the option filtering? Yes I will try that for now, looking forward to the fix! |
Yup, for now at least. The issue's been fixed internally, so you should be able to add the filtering back after next release. 😉 Thanks again for the thorough report! |
Sounds good, you're welcome. Thanks for good support, as usual 🤩 |
Description
I have a very peculiar issue with the
Form.Checkbox
component. TheonChange
handler gets a value of another component passed as itsnewValue
parameter. The value given here is what I've entered into aForm.TextArea
(with id "preCommand") component. The value that gets passed is not even a boolean, but a string. The checkbox has a uniqueid
(andkey
for that matter). I've even removed both thedefaultValue
andvalue
props from the component. I have no idea of how this value gets there, at all, and have been scratching my head for three days trying to debug this. I've come to the conclusion that this must be a bug in the API with some state being confused somehow.Raycast version: 1.34.1
@Raycast/api version: 1.34.1
Steps To Reproduce
git clone -b rsync-commands-before-after [email protected]:maxfahl/raycast-extensions.git
cd raycast-extensions/extensions/rsync-commands
npm install
npm run dev
Rsync Commands
in RaycastonChange value: PRE_COMMAND_VALUE
The weird action is going on inside of
src/components/entry-option-form-fields.tsx
, in theonChange
handler of theForm.Checkbox
component.The current behavior
Value from a different field gets passed to the onChange handler of a
Form.Checkbox
The expected behavior
I don't believe the
onChange
handler should fire at all in this case. And even if there was adefaultValue
assigned to the component, theonChange
handler shouln't be called with this value either, since it's thedefaultValue
. If I give adefaultValue
offalse
, everyEntryOptionFormFields
componentsonChange
will be called with a value offalse
.The text was updated successfully, but these errors were encountered: