NativeScript / NativeScript/NativeScript

Modal page not working after suspend/resume

Đang mở
#7,857 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

backlog bug modal-page os: android
Ngôn ngữ chính
TypeScript
Star
25.7k
Fork
1.7k
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
35

Mô tả

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.1.2
  • Cross-platform modules: latest (6.1.1)
  • Android Runtime: latest (6.1.1)

Describe the bug
Modal page not working and causing the app to crash after suspend/resume. Reproducible on NativeScript Core and NativeScript Angular.

To Reproduce

  • From "Developer options" activate "Don't keep activities"
  • Create a template app as shown in Sample Project below
  • Select a car, open the template and tap on Edit
  • Open the modal page e.g., by tapping "CLASS" - do not select an option / close the modal
  • Suspend the app via the system buttons
  • Resume the app and interact with the opened modal / navigation

Result:

  • The modal options are no longer responsive - you can't select an option or use the Cancel button.
  • Tapping outside the button will close the modal but the tapping on "Cancel" from the ActionBar will cause the app to crash with a navigation error (shown below)

Sample project

tns create my-master-detail-ts --template tns-template-master-detail-ts
cd my-master-details-ts
tns run android

Additional context

Outputed error:

System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method onClick failed
System.err: TypeError: Cannot read property 'goBack' of undefined
System.err: StackTrace:
System.err:     onCancelButtonTap(file:///app\cars\car-detail-edit-page\car-detail-edit-page.ts:20:14)
System.err:     at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify(file:///node_modules\tns-core-modules\data\observable\observable.js:110:0)
System.err:     at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit(file:///node_modules\tns-core-modules\data\observable\observable.js:127:0)
System.err:     at push.../node_modules/tns-core-modules/ui/action-bar/action-bar-common.js.ActionItemBase._raiseTap(file:///node_modules\tns-core-modules\ui\action-bar\action-bar-common.js:259:0)
System.err:     at onClick(file:///node_modules\tns-core-modules\ui\action-bar\action-bar.js:304:0)
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:1096)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1083)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1063)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1055)
System.err:     at com.tns.gen.android.view.View_OnClickListener.onClick(View_OnClickListener.java:18)
System.err:     at android.view.View.performClick(View.java:5265)
System.err:     at android.view.View$PerformClick.run(View.java:21534)
System.err:     at android.os.Handler.handleCallback(Handler.java:815)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:104)
System.err:     at android.os.Looper.loop(Looper.java:207)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:5728)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
ActivityManager: Process org.nativescript.mymasterdetailts (pid 5454) has died
ActivityManager: SVC-handleAppDiedLocked: app = ProcessRecord{a57bbda 5454:org.nativescript.mymasterdetailts/u0a161}, app.pid = 5454
ActivityManager: cleanUpApplicationRecord -- 5454

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện vấn đề với ứng dụng tns-template-master-detail-ts, tùy chọn Nhà phát triển của Android được đặt thành “Don't keep activities” và modal đang mở trong quá trình suspend/resume. Bắt đầu với onCancelButtonTap trong car-detail-edit-page.ts và các điểm vào của stack trace trong action-bar.js; hoàn thành khi các tùy chọn của modal vẫn phản hồi sau resume và Cancel không còn bị crash với lỗi điều hướng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, typescript
Lĩnh vực
mobile-dev
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.