Skip to content

Refactor Toast as BaseComponent class with native CSS autohide#42101

Open
anvme wants to merge 1 commit intotwbs:v6-devfrom
anvme:v6-toast-native
Open

Refactor Toast as BaseComponent class with native CSS autohide#42101
anvme wants to merge 1 commit intotwbs:v6-devfrom
anvme:v6-toast-native

Conversation

@anvme
Copy link

@anvme anvme commented Feb 27, 2026

Description

Refactor Toast from a side-effect-only module (raw document.addEventListener) into a proper BaseComponent class — matching the pattern used by Alert, Button, Tab, and every other Bootstrap component

Motivation & Context

After this discussion, I shared a proposal for replacing JS-heavy components with native browser APIs, similar to what was already done with Modal in v6

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [ x] Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)

Checklist

  • [ x] I have read the contributing guidelines
  • [ x] My code follows the code style of the project (using npm run lint)
  • [ x] My change introduces changes to the documentation
  • [ x] I have updated the documentation accordingly
  • [ x] I have added tests to cover my changes
  • [ x] All new and existing tests passed

Live previews

Related issues

https://github.com/orgs/twbs/discussions/42090

@anvme anvme requested review from a team as code owners February 27, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

2 participants