Fixes: https://tracker.ceph.com/issues/41667
Signed-off-by: Patrick Seidensal <pseidensal@suse.com>
mouseEvent.stopPropagation = () => {
wasCalled = true;
};
- spyOn(window, 'addEventListener').and.callFake((eventName, fn) => {
+ spyOn(component.table.element, 'addEventListener').and.callFake((eventName, fn) => {
fn(mouseEvent);
expect(eventName).toBe('mouseenter');
expect(wasCalled).toBe(true);
ngOnInit() {
// ngx-datatable triggers calculations each time mouse enters a row,
// this will prevent that.
- window.addEventListener('mouseenter', (event) => event.stopPropagation(), true);
+ this.table.element.addEventListener('mouseenter', (e) => e.stopPropagation(), true);
this._addTemplates();
if (!this.sorts) {
// Check whether the specified identifier exists.