mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Tsenov/issue 3714 (#5610)
* test: added test case for issue 3714 * refactor: update remove grid layout element
This commit is contained in:
25
apps/app/ui-tests-app/issues/issue-3714.ts
Normal file
25
apps/app/ui-tests-app/issues/issue-3714.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { EventData } from 'tns-core-modules/data/observable';
|
||||
import { Page } from 'tns-core-modules/ui/page';
|
||||
import { Button } from "tns-core-modules/ui/button";
|
||||
import { Label } from "tns-core-modules/ui/label";
|
||||
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
|
||||
import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout";
|
||||
|
||||
export function toggle(args: EventData) {
|
||||
const page = <Page>((<any>args.object).page);
|
||||
|
||||
const getElementById = id => { return page.getViewById(id); }
|
||||
|
||||
const toggleBtn = <Button>getElementById("toggleUserInteraction");
|
||||
const isEnabled = toggleBtn.text === "disable" ? true : false;
|
||||
toggleBtn.text = !isEnabled ? "disable" : "enable";
|
||||
|
||||
(<Button>getElementById("testBtn")).isUserInteractionEnabled = !isEnabled;
|
||||
(<Button>getElementById("testLabel")).isUserInteractionEnabled = !isEnabled;
|
||||
(<StackLayout>getElementById("testStackLayout")).isUserInteractionEnabled = !isEnabled;
|
||||
}
|
||||
|
||||
export function test() {
|
||||
console.log("onTap");
|
||||
alert("onTap");
|
||||
}
|
||||
11
apps/app/ui-tests-app/issues/issue-3714.xml
Normal file
11
apps/app/ui-tests-app/issues/issue-3714.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<Page
|
||||
xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
|
||||
<StackLayout class="p-20">
|
||||
<Button text="disable" tap="toggle" id="toggleUserInteraction" automationText="toggleUserInteraction"/>
|
||||
<GridLayout rows="100 50 100" id="layoutid">
|
||||
<Button id="testBtn" automationText="testBtn" row="0" isUserInteractionEnabled="{{userinteraction}}" text="test" tap="test" />
|
||||
<Label id="testLabel" automationText="testLabel" row="1" text="test" isUserInteractionEnabled="{{userinteraction}}" tap="test"/>
|
||||
<StackLayout id="testStackLayout" automationText="testStackLayout" row="2" isUserInteractionEnabled="{{userinteraction}}" backgroundColor="red" tap="test"></StackLayout>
|
||||
</GridLayout>
|
||||
</StackLayout>
|
||||
</Page>
|
||||
@@ -21,6 +21,7 @@ export function loadExamples() {
|
||||
examples.set("3175", "issues/issue-3175");
|
||||
examples.set("3211", "issues/issue-3211");
|
||||
examples.set("1639", "issues/issue-1639");
|
||||
examples.set("3714", "issues/issue-3714");
|
||||
examples.set("1657-ios", "issues/issue-1657-ios");
|
||||
examples.set("tabview-with-scrollview_4022","issues/tabview-with-scrollview_4022");
|
||||
examples.set("3354-ios", "issues/issue-3354");
|
||||
|
||||
Reference in New Issue
Block a user