FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(ios-modal): closeCallback not being called with popover presentation style by VladimirAmiorkov · Pull Request #7161 · NativeScript/NativeScript · GitHub

fix(ios-modal): closeCallback not being called with popover presentation style - #7161

Closed
VladimirAmiorkov wants to merge 1 commit into
masterfrom
amiorkov/modal-close-callback-fix
Closed

VladimirAmiorkov wants to merge 1 commit into
masterfrom
amiorkov/modal-close-callback-fix

Conversation

Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

What is the new behavior?

Fixes/Implements/Closes #[Issue Number].
Fixes #7050

Developer notes

This PR introduces a new event popoverClosed to the View class. This event is raised when a modal using the presentationStyle: UIModalPresentationStyle.Popover is closed by tapping outside of the popup area.

cla-bot Bot added the cla: yes label Apr 17, 2019
ghost added the in progress label Apr 17, 2019
MartoYankov changed the title Fix for closeCallback not being called with presentationStyle UIModalPresentationStyle.Popover fix(ios-modal): closeCallback not being called with popover presentation style Apr 22, 2019
Comment thread tns-core-modules/ui/core/view/view.d.ts Outdated
/**
* String value used when hooking to popoverClosed event.
*/
public static popoverClosedEvent: string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

If this event should be used only internally for the time being when we don't have closing events, it should be private.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

At the moment it is not restricted to only internal use, for example I am using it in the nativescript-angular code to handled its ModalService closing implementation. I was thinking of implementing additional delegate methods of the UIPopoverPresentationControllerDelegate like this popoverPresentationControllerShouldDismissPopover and an related event that the user could handled in order to "dismiss" the closing but it felt like a bigger feature than this fix. I think its better suited for a different PR with that new functionality.

parentController.dismissViewControllerAnimatedCompletion(animated, whenClosedCallback);
if (this.viewController.popoverPresentationController && this.viewController.popoverPresentationController instanceof UIPopoverPresentationController) {
whenClosedCallback();
parentController.dismissViewControllerAnimatedCompletion(animated, null);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this is a breaking change. The closed callback function will be called before the popover modal is closed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I do not think so. The actual popover modal has already been closed before hitting the new popoverPresentationControllerDidDismissPopover which calls the _closeModalCallback which finally calls this code.

false);
}

export function onPopoverModal(args: EventData) {

manoldonev Apr 22, 2019 •
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Actual test cases that use the test app are added here (by developer) -- https://github.com/NativeScript/NativeScript/tree/master/e2e/modal-navigation/e2e

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hi @manoldonev ,

I talked with @SvetoslavTsenov to add one after the PR but I could try to implement one myself.

VladimirAmiorkov force-pushed the amiorkov/modal-close-callback-fix branch from 719e118 to c5f5bd6 Compare April 30, 2019 12:51
…and handle calling modal `closeCallback` #7050

chore: add example that shows "popover" mode for modal views
VladimirAmiorkov force-pushed the amiorkov/modal-close-callback-fix branch from c5f5bd6 to 9e01346 Compare April 30, 2019 12:51

Copy link
Copy Markdown
Contributor Author

Closing in favor of new PR to the release branch: #7189

ghost removed the in progress label Apr 30, 2019
VladimirAmiorkov deleted the amiorkov/modal-close-callback-fix branch April 30, 2019 14:39

lock Bot commented May 5, 2020

Copy link
Copy Markdown

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.

lock Bot locked and limited conversation to collaborators May 5, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using "UIModalPresentationStyle.Popover" for showModal causes the closeCallback to not be called

3 participants


Back | FazBrowse Home | New Git URL