mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(button): ios let the gesture observer handles tap events
in some weird cases like i some UICollectionView layouts the UIControlEvents.TouchUpInside is failing
This commit is contained in:
@@ -28,7 +28,7 @@ export function createPage() {
|
||||
//buttonTwoWay.automationText = "buttonTwoWay";
|
||||
|
||||
buttonSetText.text = 'SetText';
|
||||
buttonSetText.on(buttonModule.Button.tapEvent, function () {
|
||||
buttonSetText.on(buttonModule.tapEvent, function () {
|
||||
targetOneWay.text = 'Test';
|
||||
targetTwoWay.text = 'Test';
|
||||
});
|
||||
@@ -47,7 +47,7 @@ export function createPage() {
|
||||
buttonOneWay.on(buttonModule.Button.loadedEvent, function () {
|
||||
buttonOneWay.text = sourceOneWay.get('textSource');
|
||||
});
|
||||
buttonOneWay.on(buttonModule.Button.tapEvent, function () {
|
||||
buttonOneWay.on(buttonModule.tapEvent, function () {
|
||||
buttonOneWay.text = sourceOneWay.get('textSource');
|
||||
});
|
||||
|
||||
@@ -67,7 +67,7 @@ export function createPage() {
|
||||
buttonTwoWay.on(buttonModule.Button.loadedEvent, function () {
|
||||
buttonTwoWay.text = sourceTwoWay.get('textSource');
|
||||
});
|
||||
buttonTwoWay.on(buttonModule.Button.tapEvent, function () {
|
||||
buttonTwoWay.on(buttonModule.tapEvent, function () {
|
||||
buttonTwoWay.text = sourceTwoWay.get('textSource');
|
||||
});
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ export function stack0Loaded(args: observable.EventData) {
|
||||
target.bind(bindingOptions, source);
|
||||
source.set('textSource', 'Text');
|
||||
|
||||
button.on(buttonModule.Button.tapEvent, function () {
|
||||
button.on(buttonModule.tapEvent, function () {
|
||||
button.text = source.get('textSource');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ export function createPage() {
|
||||
|
||||
var btn = new button.Button();
|
||||
btn.text = 'Alert';
|
||||
btn.on(button.Button.tapEvent, function () {
|
||||
btn.on(button.tapEvent, function () {
|
||||
alert('Alert is global');
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Observable } from '@nativescript/core/data/observable';
|
||||
import { Button } from '@nativescript/core/ui/button';
|
||||
import { Button, tapEvent } from '@nativescript/core/ui/button';
|
||||
import { Color } from '@nativescript/core/color';
|
||||
import { WrapLayout } from '@nativescript/core/ui/layouts/wrap-layout';
|
||||
import { alert } from '@nativescript/core/ui/dialogs';
|
||||
@@ -65,7 +65,7 @@ export class TestPageMainViewModel extends Observable {
|
||||
btn.style.backgroundColor = new Color(this._colors[count++ % 3]);
|
||||
btn.style.borderRadius = 5;
|
||||
btn.on(
|
||||
Button.tapEvent,
|
||||
tapEvent,
|
||||
function (eventData) {
|
||||
let text = btn.text;
|
||||
this.loadExample(text);
|
||||
|
||||
Reference in New Issue
Block a user