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

Preview popout reparent: iTwinUI ProgressRadial shows "Loading" text when popped out #2230

Closed
Juliakas opened this issue Jul 3, 2024 · 6 comments · Fixed by iTwin/appui#946 or #2252
Assignees
Labels
bug Something isn't working

Comments

@Juliakas
Copy link
Contributor

Juliakas commented Jul 3, 2024

Describe the bug

When ProgressRadial is popped out, it's shadow dom loses it's styling and "Loading" text is being displayed even though it was supposed to be hidden:
image

This doesn't happen when component is rendered initially in new window, only when transition from main to new window is happening and widget dom is being moved.

I reproduced everything on appui storybook (on release/4.15.0 tag) by changing widget content to ProgressRadial in ReparentPopoutWidgets.tsx file.

To Reproduce

  1. Have a widget with ProgressRadial spinner.
  2. Pop out widget.
  3. Notice "Loading" text being shown inside spinner.

Expected Behavior

Expected for loading text to remain hidden when transitioning.

Screenshots

image

Desktop (please complete the applicable information)

OS: Windows 11
Browser: Microsoft Edge
Browser version: Version 126.0.2592.68 (Official build) (64-bit)
Appui version: 4.15.0 (reproduced on source)

Additional context

Would need this fixed before our Modeler's release, our feature freeze is at beggining of next month. At worst we would need a workaround or to opt out of iTwinUI's accessibility shadow dom usage

@Juliakas Juliakas added the bug Something isn't working label Jul 3, 2024
@mayank99
Copy link
Contributor

mayank99 commented Jul 8, 2024

Is this a bug in iTwinUI or in AppUI? If it's in iTwinUI, it'd be helpful to see a minimal repro.

@Juliakas
Copy link
Contributor Author

Juliakas commented Jul 8, 2024

Interaction bug, so I guess both until determined :D

There is a lot of appui logic involved for this, not very feasible to make iTwinUI sandbox - when popping out React state is intact, dom gets reparented instead. I reproduced it in appui storybook at my local build by just putting a spinner in widget with preview popout feature. Didn't figure out permissions to push branch

@mayank99
Copy link
Contributor

mayank99 commented Jul 8, 2024

I just tested that ProgressRadial works fine when rendering in a popout window.

So the issue is probably in AppUI's reparenting logic. I guess it makes sense that if you're forcing the state to be preserved, it's not going to re-add its internal styles in the new window. We might need to detect if the component is moved to a new window and re-run that logic.

@Juliakas
Copy link
Contributor Author

Juliakas commented Jul 9, 2024

Yeah so on initial render in appui's popout it also works fine. The issue happens when transferring dom, it doesn't copy over shadow dom styles somehow

@mayank99
Copy link
Contributor

Reopening this in iTwinUI since there is some work left to be done. AppUI now exposes a appui:reparent DOM event which iTwinUI can listen to and re-add shadow DOM stylesheets.

@mayank99
Copy link
Contributor

This been fixed by iTwinUI in 3.15.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants