Skip to content

Conversation

@devinZhou102
Copy link

  1. webview not work well when tab changed
  2. webview leads crash when tab changed before the webview load properly

2. webview leads crash when tab changed before the webview load properly
@ThomasDallmeier
Copy link

If you change the tab and then go back to the tab with teh webview, the webview is empty

@charleypeng
Copy link
Contributor

If you change the tab and then go back to the tab with teh webview, the webview is empty

this issue can be fixed by using the pr in this repo, yes you have to build it by yourself

@derekantrican
Copy link

This is probably related to the issue I submitted as #20 and actually added a fix for this within Avalonia itself (since this project doesn't seem to get much attention anymore)

derekantrican added a commit to derekantrican/Avalonia.WebView that referenced this pull request Jun 7, 2024
@BobbyCannon
Copy link

Excellent fix, thanks for this.

@lostmsu
Copy link

lostmsu commented Aug 18, 2024

@charleypeng which PR are you referring to?

@lostmsu
Copy link

lostmsu commented Aug 19, 2024

If you are hitting this, I solved it by replacing TabControl with TabStrip which does not detach anything from visual tree and does not prompt destruction of native elements (which lost browser state). Instead I just toggle visibility of the stuff in the main area based on the selected tab

Example:

<Grid RowDefinitions="Auto, *">
  <TabStrip>
    <TabStripItem x:Name="PayoutTab">
      <TextBlock Text="Payout" />
    </TabStripItem>
    <TabStripItem x:Name="SetupTab">
      <TextBlock Text="Setup" />
    </TabStripItem>
  </TabStrip>

  <WebView Grid.Row="1" Url="https://stripe.com"
           IsVisible="{Binding #PayoutTab.IsSelected}" />
  <TextBlock Grid.Row="1"
             IsVisible="{Binding #SetupTab.IsSelected}" >
    Some real setup here.
  </TextBlock>
</Grid>

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

Successfully merging this pull request may close these issues.

6 participants