PrimaryButtonDecorator: Only mark a single button primary#389
Merged
nilmerg merged 1 commit intoJun 16, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts PrimaryButtonDecorator behavior so it only marks the form’s configured submit button as primary (instead of marking every submit button), aligning the decorator with how \ipl\Html\Form::setSubmitButton() is intended to define the “primary” submit action.
Changes:
- Update
PrimaryButtonDecoratorto only addbtn-primaryto the submit button returned by\ipl\Html\Form::getSubmitButton(). - Update and extend the unit tests to cover default behavior (first submit button) and explicitly selected submit button behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/Compat/FormDecorator/PrimaryButtonDecoratorTest.php | Updates expectations and adds coverage for default vs explicitly set submit button primary selection. |
| src/Compat/FormDecorator/PrimaryButtonDecorator.php | Changes decoration logic to only mark the configured submit button as primary (for \ipl\Html\Form instances). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
It applies now only to implementations of `\ipl\Html\Form`. But the reality was that it previoulsy relied on `\ipl\Html\Contract\FormElements` instead which the method's interface didn't guarantee either. closes #388
f6b4abb to
2d89d09
Compare
sukhwinder33445
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It applies now only to implementations of
\ipl\Html\Form. But the reality was that it previoulsy relied on\ipl\Html\Contract\FormElementsinstead which the method's interface didn't guarantee either.closes #388