Add tabIndex() method to Button widget#305
Conversation
Mister-42
commented
Mar 24, 2026
| Q | A |
|---|---|
| Is bugfix? | ❌ |
| New feature? | ✔️ |
| Breaks BC? | ❌ |
| Tests pass? | ✔️ |
| Fixed issues |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #305 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 711 712 +1
===========================================
Files 22 22
Lines 2934 2936 +2
===========================================
+ Hits 2934 2936 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@Mister-42 please check Psalm. |
There was a problem hiding this comment.
Pull request overview
Adds a tabIndex() fluent API to the Yiisoft\Bootstrap5\Button widget so consumers can set the HTML tabindex attribute directly when rendering buttons.
Changes:
- Add
Button::tabIndex(?int $value)that maps to thetabindexHTML attribute. - Add a PHPUnit test asserting
tabindex="42"is rendered on the button. - Update
CHANGELOG.mdto document the enhancement.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Button.php |
Introduces the tabIndex() method and documents tabindex behavior. |
tests/ButtonTest.php |
Adds coverage to verify tabindex is rendered as expected. |
CHANGELOG.md |
Records the new feature under the upcoming release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
As far as I can see all Psalm errors are caused by deprecation, not introduced by me. Correct me if I'm wrong. |
|
Yes. You're correct. |
|
Thank you! |