-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] Shell recreates a new custom renderer when tap back #9073
Comments
@Erdogan34 Can you please attach a small project that demonstrates this issue? Thanks! |
Please, refer problem details on the xamarin forum; demo repo; thanks |
This issue is similar to this But just a different version of it and I'd say worse 👎 since bottom tabs are the default so it'll just dispose the whole hierarchy as you navigate by default. When you click between bottom tabs it swaps out the fragment instead of just retaining it and hiding it. The tricky thing here is gauging the offscreen limit to use so that too many tabs doesn't slow down the performance too much. But we could by default just use some basic value like 3 or so |
Thank you @PureWeen. I wish a chance and an option to use the behavior for any specific tab. For example; |
@Erdogan34 Which we could generalize to any forms element which would be really useful for cases where elements are removed from the cross platform tree but you don't want the renderer to dispose Ideally we can reinvigorate that and then apply it here |
My eye is on the road :) |
I have a similar issue about this, if you have two Tabs and each one contains a WebView like this:
And then when you switch between Tabs, both Webview will reload content when it is activated and cannot keep the loaded content and scroll position. |
Hello @Li-Yanzhi, do you have the problem with iOS too? |
<Tab Title="Profile" IsContentPreserved="True"> |
@ahmedalejo My xf version is 4.5.0.495 but I couldn't use the TapDispose and IsContentPreserved behaviors, not coming with IntelliSense. |
What's new about this issue? @samhouts Could you give us any news about this fix? |
Still a mystery |
I have the same behavior, with two page (one with webview and other without). When webview reload, it lost all sessionstorage too. I opened a question in microsoft q&a : |
I keep trying to do some workaround, especially when the app is in background, because the users loses all the data they was typing. Someone can help me? I tried to create a static webview, but it did'nt work.
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Any update on this @jfversluis ? It's been assigned to every service release since 5 but not fixed, and the board for SR11 doesn't seem to have been populated yet. If it can't be fixed or isn't a priority I'll need to remove Shell from my project (as I need a custom renderer for webview and on Android tab navigation needs to preserve the original webview that was open when the user navigated away from the tab, not recreate it). Would appreciate an update regarding this issue's priority, as I'll need to plan in some additional work on my project if this can't be resolved soon-ish. Many thanks! |
At this moment I can't tell you when this will be fixed. So if those are your options I guess you will have to do what you have to, or of course, is this really a priority to you, feel free to provide a PR with a fix. Thanks! |
@jfversluis I want to fix it but I do not know how to do it. |
I have the same issue. |
So will this ever be fixed? Only the Android version does this. |
Description
Shell recreates a new custom renderer for a web view when coming back instead of using the prior one.
Steps;
Tab 1 name is "Web" (includes a webview)
Tab 2 name is "Profile"
If I tap the Web tab, I see the home page of the webview. If I tap the "Profile" tab and then back to the "Web" tab, each time creates a new webview and fires the OnElementChanged method inside custom webview.
The text was updated successfully, but these errors were encountered: