Skip to content
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

[BottomSheet] No content shown when used with RAD SideDrawer #462

Closed
alexander-mai opened this issue May 2, 2024 · 13 comments
Closed

[BottomSheet] No content shown when used with RAD SideDrawer #462

alexander-mai opened this issue May 2, 2024 · 13 comments

Comments

@alexander-mai
Copy link
Contributor

An Empty white BottomSheet is shown, when it is used in Combination with RAD SideDrawer as Root-Element.

Which platform(s) does your issue occur on?

  • iOS 17.4
  • emulator and device

Please, provide the following version numbers that your issue occurs with:

  • CLI: 8.7.0
  • Cross-platform modules: 8.7.2
  • Runtime(s): 8.7.1
  • Plugin(s):
    • @nativescript-community/ui-material-bottomsheet: 7.2.43+
    • nativescript-ui-sidedrawer: 15.2.3

Please, tell us how to recreate the issue in as much detail as possible.

Create an app with nativescript-ui-sidedrawer as root element. An opened bottomSheet is only white without any content.
On Android is the content of the bottomsheet correctly shown.
The problem exists since ui-material-bottomsheet version 7.2.43

Is there any code involved?

@farfromrefug
Copy link
Member

@alexander-mai sorry to hear that. If i find time i ll take a look, but i dont support RAD sidedrawer (too complex, too old, and not open source). I would advise to use @nativescript-community/ui-drawer

@alexander-mai
Copy link
Contributor Author

Thank you @farfromrefug for your fast response.
I would like to use @nativescript-community/ui-drawer, but it is not possible to use it as root element afaik. Has this changed in the last month?

@farfromrefug
Copy link
Member

@alexander-mai not sure why it would not be possible. Do you have a link to an error ?

@alexander-mai
Copy link
Contributor Author

I have tested it some years ago and there is also an Issue about the root problem: nativescript-community/ui-drawer#3.
I will give it a new try in the next days.

@JWiseCoder
Copy link

JWiseCoder commented May 24, 2024

This issue was caused by 9a524e0

The problem appears to be the change in which view controller it's using to display the bottom sheet. In theory, it should be using the same one, provided it's not a nested bottom sheet. But instead currentView defaults to the root view, and the parentController becomes the view controller of that. But before, parentController was the nearest viewController up the view hierarchy.

@farfromrefug, is this not the case?

Edit: I can fix this issue for my app if I just comment out the this.parent = Application.getRootView(); override that's happening in _showNativeBottomSheet. This is overriding the NativeScript view's parent property. Can this not at least be put in an if so it only overrides it when it needs to for showing the nested bottom sheets? According to NS documentation, the parent property should be readonly.

@farfromrefug
Copy link
Member

@JWiseCoder thanks for investigating this! Indeed could be the issue. I ll take a look next week

@JWiseCoder
Copy link

JWiseCoder commented May 24, 2024

@farfromrefug - After some more testing, found it works on 7.2.11, but breaks on 7.2.12 (and thereafter). I think it was this commit where the parent was first being overridden: ae4d6cc

@alexander-mai
Copy link
Contributor Author

In my opinion, the problem is caused by this change: cbd325c
I have no problem using version 7.2.42. With next version 7.2.43 the bottomsheet is broken.

If I understand it right, setting this.parent = Application.getRootView(); before this._setupAsRootView({}); sets the RadSideDrawer as this.parent.
Before this change, the bottomsheet itself became the root view by this._setupAsRootView({}); and this.parent = Application.getRootView(); sets the bottomsheet itself as parent.
Please correct me if I'm wrong.

@farfromrefug
Copy link
Member

@alexander-mai could be related yes. So you understand the reason why i now set RootView as parent is for the bottom sheet to correctly inherit root css variables/classes
Looking at it

@farfromrefug
Copy link
Member

@alexander-mai @JWiseCoder should be fixed in latest!

@alexander-mai
Copy link
Contributor Author

I have tested the changed from your pull request in my app with the current version of the bottomsheet and the RadSidedrawer as root element. It works perfectly.

Thank you very much @farfromrefug.

@farfromrefug
Copy link
Member

@alexander-mai can we close this now?

@alexander-mai
Copy link
Contributor Author

Yes, I think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants