-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to use actions in js using ensemble object #1037
Conversation
@nehal076 once PR has been approved, please document here - https://github.com/EnsembleUI/ensemble_docs/tree/main/actions |
bottomModalContext, scopeManager.dataContext.eval(payload)); | ||
} | ||
return Future.value(null); | ||
return Navigator.maybePop(context, scopeManager.dataContext.eval(payload)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this will only work for the simplest use case where the widget is defined directly in the same block. The context here can belong to a deeply nested widget - hence the reason we want to travel up to the root to dismiss the dialog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay @vusters, actually ContextScopeWidget.getRootContext(context)
was returning null, so the dialog was never dismissed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nehal076 figure out a solution that takes into account the fact that sometimes this could be deeply nested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vusters we don't really travel up to the root, we were just checking the root and ignoring all other contexts and that is incorrect and did not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vusters I've done this, if the rootContext
is not null, it will use root context, else it will use the local context to dismiss the modal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this works even when called from deeply nested widget?
bottomModalContext, scopeManager.dataContext.eval(payload)); | ||
} | ||
return Future.value(null); | ||
return Navigator.maybePop(context, scopeManager.dataContext.eval(payload)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nehal076 figure out a solution that takes into account the fact that sometimes this could be deeply nested.
bottomModalContext, scopeManager.dataContext.eval(payload)); | ||
} | ||
return Future.value(null); | ||
return Navigator.maybePop(context, scopeManager.dataContext.eval(payload)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vusters we don't really travel up to the root, we were just checking the root and ignoring all other contexts and that is incorrect and did not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the unnecessary files like appdelegate, gradle, podfile
bottomModalContext, scopeManager.dataContext.eval(payload)); | ||
} | ||
return Future.value(null); | ||
return Navigator.maybePop(context, scopeManager.dataContext.eval(payload)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this works even when called from deeply nested widget?
Closes #971