-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(input): duplicate triggering of input events #1323
Conversation
🦋 Changeset detectedLatest commit: 5c227d1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 34 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@tianenpang is attempting to deploy a commit to the NextUI Team on Vercel. A member of the Team first needs to authorize it. |
Huge thanks! @tianenpang |
Hi @jrgarciadev, this PR only updates the |
Yes @tianenpang I'd be nice to apply the same change to other components |
Closes #1308
📝 Description
This PR fixes the issue where native DOM events for the input were being triggered twice. This issue was caused by the duplication of
inputProps
andotherProps
in themergeProps
.Firstly,
inputProps
is derived fromoriginalProps
after being processed byuseTextField
, which already includes the native DOM events. Secondly,otherProps
also contain a similar set of props.In this scenario, there could be two identical DOM event functions present in
mergeProps
. However, withinmergeProps
, the identical functions are executed in a chain (source), leading to the execution of the functions twice.⛳️ Current behavior (updates)
Filter out duplicate event functions in
filterDOMProps
.🚀 New behavior
The
filterDOMProps
utility method now supports theomitEventNames
option to prevent redundant event functions. (Skips only functions with names starting withon[A-Z]
).💣 Is this a breaking change (Yes/No):
No.
📝 Additional Information
Test cases have been added and passed successfully.