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

Crash with TabView #53

Open
632575987 opened this issue Aug 16, 2020 · 9 comments
Open

Crash with TabView #53

632575987 opened this issue Aug 16, 2020 · 9 comments
Milestone

Comments

@632575987
Copy link

632575987 commented Aug 16, 2020

I have a custom control which contains two monaco-editor , when I add the tabviewitem(content is that custom control) to tabview
and click the tabviewitem ,app crashed.

@hez2010
Copy link
Contributor

hez2010 commented Aug 23, 2020

It caused by a stackoverflow between DependencyProperty and Property while there're multiple CodeEditor instances:



A workaround is removing properties ReadOnly, CodeLanguage and HasGlyphMargin and use Options directly instead.

@632575987
Copy link
Author

It casused by a stackoverflow between DependencyProperty and Property while there're multiple CodeEditor instances:

A workaround is removing properties ReadOnly, CodeLanguage and HasGlyphMargin and use Options directly instead.

Could you compile it and publish to Nuget? I tried to compile it myself and publish to Nuget, but the control renders a white non-clickable area. So I had to directly reference the latest source code project in my project, and it works well, this way I had to install some extra software like Node, which was too complicated. Thanks~

@hez2010
Copy link
Contributor

hez2010 commented Aug 23, 2020

I'm uploading my build here directly:
Monaco.Editor.0.899.0-beta.zip

I compiled it with version 0.899.0-beta, you can put it under a local directory and add the path to your nuget config, then you can reference it directly.

@hez2010
Copy link
Contributor

hez2010 commented Jul 26, 2021

@hawkerm This should be fixed before 0.9 release.

@hawkerm
Copy link
Owner

hawkerm commented Jul 28, 2021

Linking to #21 as the crux of the issue too.

@hawkerm
Copy link
Owner

hawkerm commented Oct 26, 2021

Wonder if this is fixed by the improvements in #58... Not sure about setting up a TabView in the sample test app to reproduce, though but will need to test this out a bit in my other project. May kick-off a build soon to NuGet and just see how it goes.

@manfromarce
Copy link

It seems that this is not fixed yet (at least in version 0.9.0-beta from Nuget).

@hawkerm
Copy link
Owner

hawkerm commented Nov 11, 2021

Thanks @manfromarce for letting us know. I twiddled with how this works a bit, so that's disappointing to hear. I don't have a repo on my machine yet since it's a more complex setup than the demo app does at the moment. Did you have a similar setup to @632575987?

Can you provide some details on what your TabView XAML and DataTemplate look like where you're using Monaco? More details would help here like a stack trace or a minimal repro app.

@manfromarce
Copy link

Hi @hawkerm, I managed to avoid crashes but I noticed 2 curious issues:

  1. frame.Navigate(typeof(Page1)); triggers the TabItemsChanged event (if Page1 contains Monaco), even if the tab has not yet been added to the TabView
  2. this is probably related to multiple windows rather than TabView: I'm using code similar to the windowing sample in the XAML Controls Gallery app to create a new window when tabs are dragged out (https://github.com/microsoft/Xaml-Controls-Gallery/blob/3b12e184a5c98bcaba1085fcd9fc0f9c09fbd220/XamlControlsGallery/TabViewPages/TabViewWindowingSamplePage.xaml.cs). However, when I click on Monaco editor in the second window the focus is shifted to the first window or even if the second window gets focus the first window is always on top. Plus, when first window is closed Monaco disappers from the second window. (I'm using ApplicationView.GetForCurrentView().TryConsolidateAsync(); to close the first window and it seems to work without Monaco)

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

4 participants