Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable cancelSyntheticClickEvents globally #3510

Merged
merged 3 commits into from
Mar 3, 2022
Merged
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
7 changes: 7 additions & 0 deletions packages/component-base/src/element-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
* Copyright (c) 2021 - 2022 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import { setCancelSyntheticClickEvents } from '@polymer/polymer/lib/utils/settings.js';
import { usageStatistics } from '@vaadin/vaadin-usage-statistics/vaadin-usage-statistics.js';
import { idlePeriod } from './async.js';
import { Debouncer, enqueueDebouncer } from './debounce.js';
import { DirMixin } from './dir-mixin.js';

// This setting affects the legacy Polymer gestures which get activated
// once you import any iron component e.g iron-icon.
// It has to be explicitly disabled to prevent click issues in iOS + VoiceOver
// for buttons that are based on `[role=button]` e.g vaadin-button.
setCancelSyntheticClickEvents(false);

window.Vaadin = window.Vaadin || {};

/**
Expand Down
5 changes: 5 additions & 0 deletions packages/component-base/test/element-mixin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ describe('ElementMixin', () => {
expect(window.Vaadin.developmentModeCallback).to.be.instanceOf(Object);
expect(window.Vaadin.developmentModeCallback['vaadin-usage-statistics']).to.be.instanceOf(Function);
});

it('should set the Polymer cancelSyntheticClickEvents setting to false', async () => {
const { cancelSyntheticClickEvents } = await import('@polymer/polymer/lib/utils/settings.js');
expect(cancelSyntheticClickEvents).to.be.false;
});
});

describe('version', () => {
Expand Down