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 issues with touch actions #2713

Open
wants to merge 3 commits into
base: 3.x
Choose a base branch
from
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
11 changes: 9 additions & 2 deletions frontend/js/components/Dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@
}
},
closeFromDoc: function (event) {
if (!this.active) return

const target = event.target

if (event.type === 'scroll') {
Expand All @@ -172,8 +174,13 @@
}
}

if (!this.clickable) this.close()
else if (!this.$el.querySelector('[data-dropdown-content]').contains(target) && this.clickable) this.close()
// timeout so the click is not triggered directly
this.timer = setTimeout(() => {
this.timer = null

if (!this.clickable) this.close()
else if (!this.$el.querySelector('[data-dropdown-content]').contains(target) && this.clickable) this.close()
}, 1)
},
open: function (onShow) {
if (this.active) return
Expand Down
1 change: 1 addition & 0 deletions frontend/scss/_imports.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sections */

@import 'vendor/cropperjs';
@import 'vendor/flatpickr';
@import 'vendor/vselect';

Expand Down
30 changes: 30 additions & 0 deletions frontend/scss/vendor/_cropperjs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* make hit area for cropping points larger to help touch users crop images */

.cropper-crop-box {
container-type: inline-size;
container-name: cropbox;
}

.cropper-point::after {
content: '';
position: absolute;
inset: -2px;
}

@container cropbox (min-width: 40px) {
.cropper-point::after {
inset: -5px;
}
}

@container cropbox (min-width: 60px) {
.cropper-point::after {
inset: -10px;
}
}

@container cropbox (min-width: 100px) {
.cropper-point::after {
inset: -20px;
}
}
Loading