Skip to content

Commit

Permalink
fix(editor): Only treat as CTRL pressed by default on touch devices f…
Browse files Browse the repository at this point in the history
…or MouseEvent (#5968)
  • Loading branch information
OlegIvaniv authored and netroy committed Apr 14, 2023
1 parent 492496f commit 471be3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/editor-ui/src/composables/useDeviceSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function useDeviceSupportHelpers(): DeviceSupportHelpers {
const controlKeyCode = ref(isMacOs.value ? 'Meta' : 'Control');

function isCtrlKeyPressed(e: MouseEvent | KeyboardEvent): boolean {
if (isTouchDevice.value === true) {
if (isTouchDevice.value === true && e instanceof MouseEvent) {
return true;
}
if (isMacOs.value) {
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/mixins/deviceSupportHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const deviceSupportHelpers = Vue.extend({
},
methods: {
isCtrlKeyPressed(e: MouseEvent | KeyboardEvent): boolean {
if (this.isTouchDevice === true) {
if (this.isTouchDevice === true && e instanceof MouseEvent) {
return true;
}
if (this.isMacOs) {
Expand Down

0 comments on commit 471be3b

Please sign in to comment.