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

Popout styles load after a delay #986

Closed
raplemie opened this issue Aug 27, 2024 · 5 comments · Fixed by #994
Closed

Popout styles load after a delay #986

raplemie opened this issue Aug 27, 2024 · 5 comments · Fixed by #994
Assignees
Labels
bug Something isn't working popouts This issue is related to popouts

Comments

@raplemie
Copy link
Contributor

raplemie commented Aug 27, 2024

Describe the bug

I'm not 100% sure when this started, looks around 4.15, we dont control the application in which our packages are used. (Feels related to #940, but I don't know if this is published yet so maybe 940 would be a fix for it ?)

We are using viewport in popouts, and in order for these viewport to be working correctly, the surrounding css needs to be present so the display is flex (otherwise the viewport component does not expand all the height available)

With numerous test trying to understand what's going on, I noticed that when it does work, the styles from the classes appears to be applied at the viewport creation, while otherwise the viewport height is 0 as no styles from classes appears to be applied.

To Reproduce

I dont have an easy to reproduce path to recreate this, please contact me so I can demo and maybe we can recreate a clear path to reproduce. (Maybe a simple viewport in a popout widget would work)

Expected Behavior

The styles (classes) are downloaded and applied before the widget content is rendered.

Screenshots

No response

Desktop (please complete the applicable information)

Chrome,
AppUI 4.16.1

Additional context

Testing with overriding the ViewportComponent minheight and maxheight (through chrome dev tools overrides) always cause this to work correctly. I have tested with providing css that would cause this through the classes, but this css does not appear to be loaded when the component is mounted. So no "class" solution works over this. Our solution to this exact problem (which was much less common before) would be to override the styles directly to the viewport component, but it requires us to make a lot of changes, so if this could be fixed in a patch in AppUI as it used to work, it would be nice...

Ultimately this is a timing problem.

@raplemie raplemie added the bug Something isn't working label Aug 27, 2024
@raplemie
Copy link
Contributor Author

@ignas-k @GerardasB I see that this was moved to Full Backlog, which apparently is "Don plan to fix in the near future". This is a regression preventing the use of popout widget, our team has been trying to get this to production for the last 2 years, it would be nice to have this investigated.

@ignas-k
Copy link
Contributor

ignas-k commented Aug 29, 2024

My bad, I moved it to the wrong category. We are planning to work on it soon.

@mayank99
Copy link

@raplemie Can you elaborate on what the actual issue is? In the absence of a repro link, a screen-recording would greatly help understand what is going on. (I'm asking because I worked on #940).

@raplemie
Copy link
Contributor Author

@mayank99 Here is a demo/debug of what's going on, I created a cleaner version than my previous comment.

I describe it in the video but basically the styles are not "used" at the moment of the widget mounting in react and in our case this is causing an issue because the ViewportComponent from AppUI requires a non null height and width or otherwise crash. We added a couple of things to ensure that this is never the case, but since the css styles are not applied (inline styles do work though) this is a problem.

UpdatedDemoOfPopoutWithouthSytles.mp4

@GerardasB
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working popouts This issue is related to popouts
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants