Skip to content

Add tabIndex() method to Button widget#305

Merged
samdark merged 2 commits intoyiisoft:masterfrom
va108:master
Mar 25, 2026
Merged

Add tabIndex() method to Button widget#305
samdark merged 2 commits intoyiisoft:masterfrom
va108:master

Conversation

@Mister-42
Copy link
Contributor

Q A
Is bugfix?
New feature? ✔️
Breaks BC?
Tests pass? ✔️
Fixed issues

@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d3d3ace) to head (728b47d).
⚠️ Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samdark
Copy link
Member

samdark commented Mar 25, 2026

@Mister-42 please check Psalm.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 the tabindex HTML attribute.
  • Add a PHPUnit test asserting tabindex="42" is rendered on the button.
  • Update CHANGELOG.md to 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>
@Mister-42
Copy link
Contributor Author

@Mister-42 please check Psalm.

As far as I can see all Psalm errors are caused by deprecation, not introduced by me. Correct me if I'm wrong.

@samdark
Copy link
Member

samdark commented Mar 25, 2026

Yes. You're correct.

@samdark samdark merged commit b7779f8 into yiisoft:master Mar 25, 2026
20 of 25 checks passed
@samdark
Copy link
Member

samdark commented Mar 25, 2026

Thank you!

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.

3 participants