tidev / titanium-sdk

🚀 Native iOS and Android Apps with JavaScript
https://titaniumsdk.com/
Other
2.76k stars 1.21k forks source link

fix: handle x/y position for touch in dragstart/dragend events on iOS #14134

Closed deckameron closed 1 month ago

deckameron commented 1 month ago
var win = Ti.UI.createWindow();

var scrollView = Ti.UI.createScrollView({
  showVerticalScrollIndicator: true,
  showHorizontalScrollIndicator: true,
  height: '80%',
  width: '80%'
});
var view = Ti.UI.createView({
  backgroundColor:'#336699',
  borderRadius: 10,
  top: 10,
  height: 2000,
  width: 1000
});
scrollView.add(view);
scrollView.addEventListener("dragstart", function(e){
    console.log(e.x, e.y);
})
scrollView.addEventListener("dragend", function(e){
    console.log(e.x, e.y);
})
win.add(scrollView);
win.open();

The Android version is this: https://github.com/tidev/titanium-sdk/pull/14102

hansemannn commented 1 month ago

Hi @deckameron! Thanks for your PR! Can you rename "drag_dict" to "event" or "dict" for better consistency please? We usually don't use snake_case in the code :-) That'd be great! And we need the CLA signed once, you can learn more about it here. tldr: Contact @joshualambert via TiSlack

m1ga commented 1 month ago

you can use https://tidev.io/contribute to automatically sign the CLA

hansemannn commented 1 month ago

Thx! I just updated the page

deckameron commented 1 month ago

Thanks guys! I just signed the CLA and pushed the update you requested. :-)

hansemannn commented 1 month ago

Awesome, thank you! Great improvement!

m1ga commented 1 month ago

@hansemannn can we merge the Android part of it too: https://github.com/tidev/titanium-sdk/pull/14102 it has the docs for this