NativeScript / NativeScript/plugins

iOS Listview & InputFields

未關閉
#301 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
TypeScript
星號
206
分支
123
平均合併
2 天 1 小時
30 天內合併 PR
1

描述

Hello everyone;

I have a nativescript angular project that has a few DateTimePickerFields inside of some ListViews that behaves unreliably on iOS (android is completely fine).

Essentially, if i have a ListView with 3 separate DateTimePickerFields, and I tap&set the DTPF at position 0, a random other DTPF will get the value.

My knowledge with Nativescript & Angular is limited; so if I'm doing something wrong or if anyone has some tips/tricks i would be greatly appreciative.

(demo of app and issue)

ezgif com-gif-maker

(inputs on item of index 0 usually work; once we touched DTPF index 2, the value goes in DTF index1 and yeah...)

(simplified code)

PMSubDetailsMooringsComponent.html

  <ListView
      [items]="displayItems"
      [itemTemplateSelector]="selectItemTemplate"
    >
      <ng-template
        let-item="item"
        let-i="index"
      >
        <FlexboxLayout
          flexDirection="column"
        >
          <Label
            [text]="'index:'+ i"
          ></Label>

          <DateTimePickerFields
            [(ngModel)]="item"
            (touch)="yes(i)"
          ></DateTimePickerFields>
       </FlexboxLayout>
     </ng-template>
</ListView>

PMSubDetailsMooringsComponent.ts

export class PMSubDetailsMooringsComponent extends PMBaseComponent {
    displayItems: Date = {[null,null,null]}        
    index = -1;



 yes(i) {
        //just using this to display what value got touched
        this.index = i;
    }
}

"dependencies": {
"@angular-devkit/build-angular": "14.0.0",
"@angular/animations": "14.0.0",
"@angular/common": "14.0.0",
"@angular/compiler": "14.0.0",
"@angular/core": "14.0.0",
"@angular/forms": "14.0.0",
"@angular/platform-browser": "14.0.0",
"@angular/platform-browser-dynamic": "14.0.0",
"@angular/router": "14.0.0",
"@bezlepkin/nativescript-ar": "^1.0.4",
"@jeanbenitez/logical-expression-parser": "^1.0.0",
"@nativescript-community/drawingpad": "^4.1.0",
"@nativescript-community/ui-pulltorefresh": "^2.4.8",
"@nativescript/angular": "13.0.4",
"@nativescript/appversion": "^2.0.0",
"@nativescript/background-http": "^5.0.2",
"@nativescript/core": "8.2.5",
"@nativescript/datetimepicker": "2.1.11",
"@nativescript/fingerprint-auth": "^8.0.0",
"@nativescript/firebase": "^11.1.3",
"@nativescript/imagepicker": "^1.0.6",
"@nativescript/iqkeyboardmanager": "2.0.0",
"@nativescript/picker": "4.0.1",
"@nativescript/secure-storage": "^3.0.0",
"@nativescript/theme": "~3.0.0",
"@nstudio/nativescript-barcodescanner": "^5.0.1",
"@nstudio/nativescript-cardview": "2.0.1",
"@nstudio/nativescript-checkbox": "2.0.5",
"@nstudio/nativescript-filterable-listpicker": "^3.0.0",
"@ticnat/nativescript-searchable-select": "^1.0.7",
"crypto-browserify": "^3.12.0",
"moment": "^2.29.1",
"moment-timezone": "^0.5.34",
"nativescript-carousel": "^7.0.1",
"nativescript-localstorage": "^2.0.2",
"nativescript-mediafilepicker": "^4.0.2",
"nativescript-permissions": "1.3.11",
"nativescript-plugin-filepicker": "file:libraries/nativescript-plugin-filepicker-1.0.1.tgz",
"nativescript-ui-calendar": "^7.0.2",
"nativescript-ui-core": "5.0.1",
"nativescript-ui-gauge": "8.0.0",
"nativescript-ui-listview": "10.2.2",
"nativescript-ui-sidedrawer": "^10.0.1",
"stream-browserify": "^3.0.0",
"typescript": "4.6.4",
"zone.js": "0.11.5"
},
"devDependencies": {
"@angular/cli": "14.0.0",
"@angular/compiler-cli": "14.0.0",
"@nativescript/android": "8.0.0",
"@nativescript/ios": "8.3.0",
"@nativescript/schematics": "^11.0.0",
"@nativescript/types": "~8.1.0",
"@nativescript/webpack": "5.0.6",
"@ngtools/webpack": "14.0.0",
"@types/node": "^17.0.41",
"sass": "~1.39.0"
},

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 PMSubDetailsMooringsComponent.html 和 PMSubDetailsMooringsComponent.ts 開始,重點關注 ListView、itemTemplateSelector 和 DateTimePickerFields 的繫結。使用提供的三項範例在 iOS 上重現該行為,然後將被點選的索引與更新後的值進行比較。當所選欄位始終接收到自身的值,且已在 iOS 和 Android 上驗證該行為時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
angular, ios, typescript
領域
mobile-dev
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。