yes
If both longPress and tap event are bound to a button, after the button is long pressed, the tap event is fired as well
Android
Add this button:
<Button [text]="'LOG IN'"
(tap)="login()" (longPress)="long()"></Button>
Then long-press it.
the long() callback will be called, and then the login() callback as well.
If you release your long-pressing-finger outside the button, the login() callback won't be called.
Hi @nirsalon,
I reviewed this issue and found that this is something related with the platform. However if you want to trigger single event for the Button
you could attached several gestures on Button
loaded
event. In this case only one the events will be fired . You could review the below-given example, where has been shown how to do that.
app.component.html
<StackLayout>
<Label text="Tap the button" class="title"></Label>
<Button (loaded)="buttonloaded($event)" text="TAP"></Button>
<Label [text]="message" class="message" textWrap="true"></Label>
</StackLayout>
app.component.ts
import {Component} from "@angular/core";
@Component({
selector: "my-app",
templateUrl: "app.component.html",
})
export class AppComponent {
public buttonloaded(args){
var button = args.object;
button.on("loaded, tap, doubleTap, longPress", function (args) {
console.log("Event: " + args.eventName + ", sender: " + args.object);
});
}
}
Let me know whether this helps or if I could help you further.
Thank you, @tsonevn. This also works on ns vue.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Hi @nirsalon,
I reviewed this issue and found that this is something related with the platform. However if you want to trigger single event for the
Button
you could attached several gestures onButton
loaded
event. In this case only one the events will be fired . You could review the below-given example, where has been shown how to do that.app.component.html
app.component.ts
Let me know whether this helps or if I could help you further.