Skip to content

Commit de81c14

Browse files
committed
UX: Prevent touch start events in 30px distance to the left photoprism#4777
Signed-off-by: Michael Mayer <michael@photoprism.app>
1 parent 3a24d88 commit de81c14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/src/common/view.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export function isMediaElement(el) {
3737
export function preventNavigationTouchEvent(ev) {
3838
if (ev instanceof TouchEvent && ev.cancelable) {
3939
// console.log(`${ev.type} @ ${ev.touches[0].clientX.toString()} x ${ev.touches[0].clientY.toString()}`, ev.target);
40-
if (ev.type === TouchStartEvent && (isMediaElement(ev.target) || ev.touches[0].clientX <= 16)) {
41-
if (window.innerHeight - ev.touches[0].clientY > 128 || ev.touches[0].clientX <= 16) {
40+
if (ev.type === TouchStartEvent && (isMediaElement(ev.target) || ev.touches[0].clientX <= 30)) {
41+
if (window.innerHeight - ev.touches[0].clientY > 128 || ev.touches[0].clientX <= 30) {
4242
ev.preventDefault();
4343
// console.log(`prevented ${ev.type} @ ${ev.touches[0].clientX.toString()} x ${ev.touches[0].clientY.toString()}`);
4444
}

0 commit comments

Comments
 (0)