fix(Touch): fix using mouse with touch device#8883
Merged
EldarMuhamethanov merged 6 commits intomasterfrom Sep 3, 2025
Merged
Conversation
Contributor
size-limit report 📦
|
Contributor
e2e tests |
Contributor
👀 Docs deployed
📦 Package ✅yarn add @vkontakte/vkui@https://vkui-screenshot.hb.bizmrg.com/pull/8883/30e195e3aafd298db17ff81a378585a7af471522/pkg/@vkontakte/vkui/_pkg.tgzCommit 30e195e |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8883 +/- ##
==========================================
- Coverage 96.03% 96.02% -0.01%
==========================================
Files 428 428
Lines 12472 12476 +4
Branches 4113 4114 +1
==========================================
+ Hits 11977 11980 +3
- Misses 495 496 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
inomdzhon
reviewed
Sep 3, 2025
Contributor
inomdzhon
left a comment
There was a problem hiding this comment.
Откоментил как можно сделать иначе
Contributor
inomdzhon
reviewed
Sep 3, 2025
inomdzhon
approved these changes
Sep 3, 2025
BlackySoul
approved these changes
Sep 3, 2025
Contributor
BlackySoul
left a comment
There was a problem hiding this comment.
Описание задачи теперь как-то не соответствует реализации 🤔
vkcom-publisher
pushed a commit
that referenced
this pull request
Sep 3, 2025
* fix(Touch): fix using mouse with touch device * fix(Touch): fix hook using * fix(Touch): refactor logic * fix(Touch): remove type * test(Touch): add tests
1 task
5 tasks
SevereCloud
added a commit
that referenced
this pull request
Feb 9, 2026
This reverts commit 3e22f34.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание
Сейчас есть проблема, что компонент
Touchможет обрабатывать либо touch-events(если они поддерживаются), либо mouse-events. Проблема заключается в том, что если , например на планшете попытаться воспользоваться блютуз мышью, она работать не будет. Это происходит потому что мышь тригерит mouse-events, а мы слушаем touch-events. Нужно доработать механизм подписки на события так, чтобы это работало.Варианты решения
Использовать pointer-events.
Плюсы:
Минусы:
touch-action: none, так где нужно. Это breaking-changeСлушать mouse-events и touch-events в зависимости от того
mousedownилиtouchstartсработалПлюсы:
Минусы:
touchstartгенерирует еще и событиеmousedownдля совместимости со старыми браузерами. Поэтому нужно сделать механизм, который будет игнорировать такое событиеmousedown, чтобы не было дублирования срабатыванийИзменения
Было решено использовать второй вариант решения проблемы. Для этого сделал следующее:
touchустройствах подписка происходит и наmousedownиtouchstarttouchstartсрабатываетmousedownRelease notes
Исправления
Touchна планшетах с подключенной блютуз мышью