Skip to content
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(pluginform): remove reset type of cancel button #1883

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

TT1228
Copy link
Contributor

@TT1228 TT1228 commented Jan 7, 2025

Summary

KM-882

EntityBaseForm has a built-in method for reset events(https://github.com/Kong/public-ui-components/blob/fix/KM-882-duplicate-call-of-handle-click-cancel/packages/entities/entities-shared/src/components/entity-base-form/EntityBaseForm.vue#L30), so the handleClickCancel is triggered twice when cancel button is clicked(once by click event of button, once by cancel event triggered by form reset event).

Normally this not a problem because when handleClickCancel executes for the first time, router.push(props.config.cancelRoute) goes to another page so that the current component no longer exists and the second execution of handleClickCancel won't happen. However, if no props.config.cancelRoute is passed, then duplicate calls of handleClickCancel surface.

So i removed type="reset" for cancel button since handleClickCancel already handles click event of cancel button.

@TT1228 TT1228 requested review from a team as code owners January 7, 2025 03:27
Copy link
Contributor

@kaiarrowood kaiarrowood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kaiarrowood kaiarrowood merged commit 196ffae into main Jan 7, 2025
9 checks passed
@kaiarrowood kaiarrowood deleted the fix/KM-882-duplicate-call-of-handle-click-cancel branch January 7, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants