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

touchmove doesn't update currently picked item #3065

Open
sgratzl opened this issue Feb 4, 2021 · 3 comments · May be fixed by #3547
Open

touchmove doesn't update currently picked item #3065

sgratzl opened this issue Feb 4, 2021 · 3 comments · May be fixed by #3547
Labels
bug For bugs or other software errors

Comments

@sgratzl
Copy link

sgratzl commented Feb 4, 2021

I'm currently trying to implement a line chart where the user can drag over the chart and see the current underlying value.

While it works great for desktop devices using the mouse:

mouse

It doesn't seem to work on touch devices:

touch

It seems like while all the events are correctly triggered (see signal recorder), it won't update the picked element, since it will only compute it ones during touchstart, see also

this._touch = this.pickEvent(evt.changedTouches[0]);
if (this._first) {
this._active = this._touch;
this._first = false;
}
this.fire(TouchStartEvent, evt, true);
},
touchmove(evt) {
this.fire(TouchMoveEvent, evt, true);
},
touchend(evt) {
this.fire(TouchEndEvent, evt, true);
this._touch = null;
},
// fire an event
fire(type, evt, touch) {
const a = touch ? this._touch : this._active,
h = this._handlers[type];

The Vega Lite example I'm using:

https://vega.github.io/editor/#/url/vega-lite/N4IgJAzgxgFgpgWwIYgFwhgF0wBwqgegIDc4BzJAOjIEtMYBXAI0poHsDp5kTykBaADZ04JACyUAVhDYA7EABoQAEzjQATjRyZ289AHE2bMoLgByCAAIImNlADWlnJqhxLbUuss6EcSopUkTBRUUAZ1QTRA4M5bBwhKKAhiEABfJUx1JFkIADM2dQQ0AG1QXJpBTDh1KOUghgRKCABPBCY2QQBebrN9AHk+-TM0gF0lOFkoNmUaWTI0UAAPBZByuEFlWqC4AMxmnB30KoQcAqRI1PSQHCRlGbmV2xw0AEYABivBJGbqktBkdT2KLCWQ7caTaazeahEDNFZrDZRZw0Vy7faHEAARwY2R0wR0pDSlwUoAg6zgUB0chWMBoZBgwnpmEe6KiEChpgCiG0cPQsjkYJA1PQUGEDgUlmKCDYDDJyjYAHdZBKFbN5QrUNLZXAGDgRpYAHyWLVk6WkCXFWwMWA2JDqTASq2wCbKfVGp0wM2C0F2tTM1CZBhwJSiuB2tC5c5k8FTe5kCAlEDLEbEkAAoEwvYHJFsWbMpTsgBehwArB8Y5CHjDeWUaOtNuhkaiMqz0NjcXQgjRCZd0qBMtk8gUiqhSqsKlUajCyaZKboorT6YysESxmm7RmQOoGJy+yABzl8oU-uPKr9p+S58KMHSGbfmZc1+mWdmjnBFvmQOc6XpQO-nFEAAUqrKPQlj8NYUDnHAgFmIsZgSnUmANJQSFwAAlOhlgADyWAAzG8lgAPyWGYmhMmYlioJYgHQNBsHwYh9SNGhmGGvhhEkWYriyJOlHUWYpi5JgwxXEwSAzrMGLtNgbBFEoyi8vwLxXBMsZQo877+rW9ZbFUaKvvu3JnBcSg1iAxDnEGaAfI+qRAA

@sgratzl sgratzl added the bug For bugs or other software errors label Feb 4, 2021
@guersam
Copy link

guersam commented Jul 25, 2022

@sgratzl I got the same problem. Did you find any workaround?

@guersam guersam linked a pull request Jul 25, 2022 that will close this issue
@declann
Copy link

declann commented Apr 25, 2024

+1 for this

My usecase is applying Vega to declaratively make input interactions, but ineffective drag handling => no mobile is a big blocker. Heres an example and it is working on mobile due to patching PR #3547 and using canvas (thanks @guersam !).

I would love to see this fixed upstream since declarative interaction is a big unique feature of Vega!

@domoritz
Copy link
Member

@declann If this is a blocker, please help out. I agree that mobile support is really needed these days. We started some improvements in Vega recently: #3781

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For bugs or other software errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants