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

Clone attributes #110

Merged
merged 3 commits into from
Feb 17, 2023
Merged

Clone attributes #110

merged 3 commits into from
Feb 17, 2023

Conversation

lippserd
Copy link
Member

Right now we have an attribute cloning use case where we duplicate the primary submit button and add it as the first element to ensure that it is used for implicit form submission. The submit button to be cloned can have attributes and callbacks that must also be present on the clone, such as formaction, formmethod and formnovalidate, so simply not using the original attributes is not an option.

Until proper cloning is implemented, it is imperative to re-register attribute callbacks for attributes where a callback exists and the clone provides a changed value.

@lippserd lippserd added this to the v0.7.0 milestone Feb 15, 2023
@cla-bot cla-bot bot added the cla/signed label Feb 15, 2023
@lippserd
Copy link
Member Author

See Icinga/ipl-web#104 for the duplicate submit button PR and #96 for proper cloning.

Copy link
Member

@nilmerg nilmerg left a comment

Choose a reason for hiding this comment

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

Please integrate the tests from #96 here.

@lippserd lippserd force-pushed the clone-attributes branch 2 times, most recently from 528b019 to fbb3dd8 Compare February 17, 2023 07:26
@lippserd
Copy link
Member Author

Please integrate the tests from #96 here.

Added my own test. The PR referenced contains two tests that basically do the same thing, but only change one attribute. Here we also test adding and removing attributes and cloning already cloned attributes.

@lippserd lippserd requested review from nilmerg February 17, 2023 07:30
@nilmerg nilmerg added the bug Something isn't working label Feb 17, 2023
@nilmerg nilmerg merged commit fbe54a3 into master Feb 17, 2023
@nilmerg nilmerg deleted the clone-attributes branch February 17, 2023 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cla/signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants