-
Notifications
You must be signed in to change notification settings - Fork 143
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
fix(blade): Trigger native select events in dropdown/ file upload / Date picker [FC-3151] #2408
base: master
Are you sure you want to change the base?
Conversation
|
✅ PR title follows Conventional Commits specification. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 82104ef:
|
Bundle Size ReportUpdated Components
|
packages/blade/src/utils/fireNativeEvent/fireNativeEvent.web.ts
Outdated
Show resolved
Hide resolved
@@ -158,6 +159,7 @@ const _FileUpload: React.ForwardRefRenderFunction<BladeElementRef, FileUploadPro | |||
if (!hasValidationErrors) { | |||
handleFilesChange(droppedFiles); | |||
onDrop?.({ name, fileList: allFiles }); | |||
fireNativeEvent(inputRef, ['change', 'input']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the normal DOM inputs if we actually fire both of these or not. I think they do but still confirm once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checked for <input type="file" />
they do fire both change and input .
@@ -176,6 +167,7 @@ const _BaseDropdownInputTrigger = ( | |||
defaultValue: props.defaultValue, | |||
syncInputValueWithSelection: props.syncInputValueWithSelection, | |||
isSelectInput: props.isSelectInput, | |||
triggererRef, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saurabhdaware can you check this once, not sure ye kaha se agaya
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have added this in -
packages/blade/src/components/Input/DropdownInputTriggers/types.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM, Just add tests
packages/blade/src/utils/fireNativeEvent/fireNativeEvent.native.ts
Outdated
Show resolved
Hide resolved
11e0005
to
c4887f6
Compare
…rigger-native-events
Can you check for the failing tests |
@anuraghazra changes done |
Description
This pr add adds fixes -
change
orinput
event when the value is changed or committed.change
orinput
event when the file is dropped.for testing -
https://codesandbox.io/p/sandbox/razorpay-blade-basic-forked-ky8wfs?workspaceId=b3d29104-ffe4-442f-8d81-f2753e652d83
Changes
Additional Information
Component Checklist