NativeScript/nativescript-sdk-examples-ng

Text-View submit event not working

Closed this issue · 8 comments

Hi, when i click on the return key of the keyboard it does nothing.

HI @dali-gharbi,
I tested the TextField returnPress event on iOS and Android, however, was unable to recreate the reported issue. For your convenience, I am attaching GIF files for both platforms.
screencast 2018-01-03 at 1 04 28 pm
screencast 2018-01-03 at 1 08 29 pm

hi @tsonevn thanks for the fast response, actually what u shown is a basic TextField not TextView here is a GIF showing the problem on android.
the submit event is supposed to clear focus or add a new Line.

   submit(args) {
        let textview: TextView = <TextView>args.object;
        if (isAndroid) {
            textview.android.clearFocus();
        }
    }

also in the docs it's says that it support large text.

The TextView component can be used to type large text in your app. The component can also be used show any content by setting the editable property to false.

2018_01_03_16_30_50

Hi @dali-gharbi,
Thank you for the further info.
At this time the TextView does not support returnPressEvent. you could review here in the API reference, which are the supported properties and methods about this component.

Regarding that, we have already logged issue here about providing support for providing support for the similar event. You could keep track on it for further info.

actually the issue here is that when you press the enter button it is supposed to do a line break.
so it is maybe a bug not a feature.
note that on ios the line break work when pressing the enter button.
also the size of the textView is not for multiline input as expected and dosen't scale.

Hi @dali-gharbi,
I reviewed the case with the TextView component and the enter button. However, everything seems to work as expected on my side. When the Enter button is pressed, the TextView will break the line. For your convenience, I am attaching Gif file. This scenario is tested with latest NativeScript CLI 3.4.1 and modules 3.4.0.

screencast 2018-02-07 at 9 06 29 am

thanks for your answer, i see that the text View work fine for you, i am using the same version as you with latest NativeScript CLI 3.4.1 and modules 3.4.0 and the project nativescript-sdk-examples-ng.
i will try again with nativescript-sdk-examples-ng project, maybe it's a problem in certain types of keyboard or localisation.

EDITED this bug is fixed with platform-core next

Hi again @tsonevn ,
Actually i did the test another time with the current version and it's working but when i changed some dependencies similar to the ones used in my project it's no longer adding newLine when i press enter, i searched for a bug thread or bugfix but none found.
Is there any specific version in the package that did fix the bug ?.

original nativescript-sdk-examples-ng package.json

{
  "name": "nativescript-sdk-examples-ng",
  "description": "NativeScript & Angular SDK Examples",
  "author": "Telerik <support@telerik.com>",
  "version": "0.1.0",
  "homepage": "https://github.com/NativeScript/nativescript-sdk-examples-ng",
  "repository": {
    "type": "git",
    "url": "https://github.com/NativeScript/nativescript-sdk-examples-ng"
  },
  "bugs": {
    "url": "https://github.com/NativeScript/nativescript-sdk-examples-ng/issues"
  },
  "keywords": [
    "NativeScript",
    "Angular",
    "SDK",
    "example",
    "documentation"
  ],
  "license": "Apache-2.0",
  "nativescript": {
    "id": "org.nativescript.nativescriptsdkexamplesng",
    "tns-ios": {
      "version": "next"
    },
    "tns-android": {
      "version": "next"
    }
  },
  "dependencies": {
    "@angular/common": "~5.2.0",
    "@angular/compiler": "~5.2.0",
    "@angular/core": "~5.2.0",
    "@angular/forms": "~5.2.0",
    "@angular/http": "~5.2.0",
    "@angular/platform-browser": "~5.2.0",
    "@angular/platform-browser-dynamic": "~5.2.0",
    "@angular/router": "~5.2.0",
    "nativescript-angular": "next",
    "nativescript-camera": "~3.1.2",
    "nativescript-geolocation": "^4.1.1",
    "nativescript-intl": "~3.0.0",
    "nativescript-theme-core": "^1.0.4",
    "reflect-metadata": "~0.1.8",
    "rxjs": "^5.5.0",
    "tns-core-modules": "next",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~5.2.0",
    "@ngtools/webpack": "~1.9.1",
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.10.0",
    "codelyzer": "^3.0.1",
    "copy-webpack-plugin": "~4.3.0",
    "css-loader": "~0.28.7",
    "extract-text-webpack-plugin": "~3.0.2",
    "fs-extra": "^0.30.0",
    "glob": "^7.1.2",
    "lazy": "1.0.11",
    "markdown-snippet-injector": "^0.2.0",
    "nativescript-css-loader": "~0.26.0",
    "nativescript-dev-typescript": "next",
    "nativescript-dev-webpack": "next",
    "nativescript-worker-loader": "~0.8.1",
    "opener": "^1.4.1",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.2.1",
    "rimraf": "^2.5.3",
    "tar.gz": "^1.0.5",
    "tns-platform-declarations": "^3.3.0",
    "tslint": "^5.4.2",
    "typescript": "~2.6.2",
    "webpack": "~3.10.0",
    "webpack-bundle-analyzer": "^2.9.1",
    "webpack-sources": "~1.1.0",
    "uglifyjs-webpack-plugin": "~1.1.6"
  },
  "scripts": {
    "pretsc": "npm install",
    "tsc": "tsc",
    "pretslint": "npm run tsc",
    "tslint": "tslint -p tsconfig.json",
    "prebuild": "npm run tslint",
    "build": "node scripts/build.js",
    "postbuild": "npm run inject && npm run archive",
    "inject": "mdinject --root=app --docsroot=dist/code-samples --sourceext=\".ts|.css|.html\" --snippettitles=\"TypeScript|CSS|HTML\"",
    "archive": "node scripts/archive.js",
    "ns-bundle": "ns-bundle",
    "publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
    "generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install",
    "start-android-bundle": "npm run ns-bundle --android --run-app",
    "start-ios-bundle": "npm run ns-bundle --ios --run-app",
    "build-android-bundle": "npm run ns-bundle --android --build-app",
    "build-ios-bundle": "npm run ns-bundle --ios --build-app"
  }
}

edited package.json

{
  "name": "nativescript-sdk-examples-ng",
  "description": "NativeScript & Angular SDK Examples",
  "author": "Telerik <support@telerik.com>",
  "version": "0.1.0",
  "homepage": "https://github.com/NativeScript/nativescript-sdk-examples-ng",
  "repository": {
    "type": "git",
    "url": "https://github.com/NativeScript/nativescript-sdk-examples-ng"
  },
  "bugs": {
    "url": "https://github.com/NativeScript/nativescript-sdk-examples-ng/issues"
  },
  "keywords": [
    "NativeScript",
    "Angular",
    "SDK",
    "example",
    "documentation"
  ],
  "license": "Apache-2.0",
  "nativescript": {
    "id": "org.nativescript.nativescriptsdkexamplesng",
    "tns-ios": {
      "version": "3.4.1"
    },
    "tns-android": {
      "version": "3.4.1"
    }
  },
  "dependencies": {
    "@angular/common": "5.0.5",
    "@angular/compiler": "5.0.5",
    "@angular/core": "5.0.5",
    "@angular/forms": "5.0.5",
    "@angular/http": "5.0.5",
    "@angular/platform-browser": "5.0.5",
    "@angular/platform-browser-dynamic": "5.0.5",
    "@angular/router": "5.0.5",
    "nativescript-angular": "5.0.0",
    "nativescript-camera": "3.2.1",
    "nativescript-geolocation": "^4.1.1",
    "nativescript-intl": "~3.0.0",
    "nativescript-theme-core": "1.0.4",
    "reflect-metadata": "0.1.10",
    "rxjs": "5.5.6",
    "tns-core-modules": "3.4.0",
    "zone.js": "0.8.12"
  },
  "devDependencies": {
    "@angular/compiler-cli": "5.0.5",
    "@ngtools/webpack": "1.8.5",
    "babel-traverse": "6.4.5",
    "babel-types": "6.4.5",
    "babylon": "6.4.5",
    "codelyzer": "^3.0.1",
    "copy-webpack-plugin": "4.0.1",
    "css-loader": "0.28.7",
    "extract-text-webpack-plugin": "3.0.0",
    "fs-extra": "^0.30.0",
    "glob": "^7.1.2",
    "lazy": "1.0.11",
    "markdown-snippet-injector": "^0.2.0",
    "nativescript-css-loader": "~0.26.0",
    "nativescript-dev-typescript": "0.6.0",
    "nativescript-dev-webpack": "0.9.2",
    "nativescript-worker-loader": "0.8.1",
    "opener": "^1.4.1",
    "raw-loader": "0.5.1",
    "resolve-url-loader": "2.1.0",
    "rimraf": "^2.5.3",
    "tar.gz": "^1.0.5",
    "tns-platform-declarations": "3.4.0",
    "tslint": "5.9.1",
    "typescript": "2.4.2",
    "webpack": "3.8.1",
    "webpack-bundle-analyzer": "2.8.2",
    "webpack-sources": "1.0.1",
    "uglifyjs-webpack-plugin": "1.1.8"
  },
  "scripts": {
    "pretsc": "npm install",
    "tsc": "tsc",
    "pretslint": "npm run tsc",
    "tslint": "tslint -p tsconfig.json",
    "prebuild": "npm run tslint",
    "build": "node scripts/build.js",
    "postbuild": "npm run inject && npm run archive",
    "inject": "mdinject --root=app --docsroot=dist/code-samples --sourceext=\".ts|.css|.html\" --snippettitles=\"TypeScript|CSS|HTML\"",
    "archive": "node scripts/archive.js",
    "ns-bundle": "ns-bundle",
    "publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
    "generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install",
    "start-android-bundle": "npm run ns-bundle --android --run-app",
    "start-ios-bundle": "npm run ns-bundle --ios --run-app",
    "build-android-bundle": "npm run ns-bundle --android --build-app",
    "build-ios-bundle": "npm run ns-bundle --ios --build-app"
  }
}

lock commented

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.