ngx-bootstrap
ngx-bootstrap copied to clipboard
feat(tabs): add beforeRemove event to allow canceling tab removal
Summary
- Add beforeRemove event to TabDirective allowing cancellation of tab removal
- Developers can now show confirmation dialogs or prevent removal by calling event.preventDefault()
- Maintains full backward compatibility with existing removed event
- Works with both programmatic removal and keyboard (Delete key) removal
Test plan
- [x] beforeRemove event fires before tab removal
- [x] event.preventDefault() successfully cancels removal
- [x] removed event only fires if removal is not canceled
- [x] Keyboard deletion (Delete key) respects cancellation
- [x] Backward compatibility maintained for existing implementations
- [x] Unit tests cover all cancellation scenarios and edge cases
- [x] E2E tests verify behavior in real browser environment
🤖 Generated with Claude Code