Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ export default abstract class GestureHandler implements IGestureHandler {

public setGestureConfig(config: Config) {
this.resetConfig();
this.updateGestureConfig(config);
this.updateGestureConfig({ ...config, enabled: config.enabled ?? true });
}

public updateGestureConfig(config: Partial<Config>): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Config } from '../../interfaces';
import EventManager from '../../tools/EventManager';
import type { GestureHandlerDelegate } from '../../tools/GestureHandlerDelegate';
import GestureHandler from '../GestureHandler';
Expand Down Expand Up @@ -25,6 +26,16 @@ function createHandler(enabled: boolean) {
return handler;
}

describe('GestureHandler web config reset', () => {
test('a config without enabled restores the enabled default', () => {
const handler = createHandler(false);

handler.setGestureConfig({} as Config);

expect(handler.enabled).toBe(true);
});
});

describe('GestureHandler web event manager attachment', () => {
test('registers listeners for an initially enabled handler', () => {
const manager = new TestEventManager({});
Expand Down
Loading