Xamarin Forms 3.6.0.220655 & Xamarin.Forms.Visual.Material (I only tested iOS)
Using an editor with visual="Material" works on simulator but when deploying on a physical device the values entered in the editor will not be updated.
ValueInModel should change
ValueInModel changes only in Simulator not on physical device
Could you please supply a zipped up reproduction?
I can repro on:
@mfow Are you able to provide us with a reproduction project? Thanks!
I'm getting the same issue on iOS devices. XF 3.6, running on a PC with VS 2019
Here's my Editor:
<Editor Placeholder="Enter a note" Text="{Binding NoteText}" x:Name="NoteEditor" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" IsVisible="{Binding IsLoading, Converter={StaticResource NegateBooleanConverter}}" ></Editor>
and I set the Material in the App.xaml
<Style
TargetType="Editor"
ApplyToDerivedTypes="true">
<Setter Property="Visual">
<Setter.Value>
<!-- ReSharper disable once Xaml.InvalidType -->
<OnPlatform x:TypeArguments="IVisual" iOS="Material" Android="Material"/>
</Setter.Value>
</Setter>
<Setter
Property="HorizontalOptions"
Value="FillAndExpand" />
<Setter
Property="TextColor"
Value="{ DynamicResource BaseTextColor }" />
</Style>
If I set the Editor to Visual="Default" it works fine on physical devices.
XF 3.6 on VS 2019, PC
I have a repro project, but it's confidential. Let me know the email to send it to if you need it. @kingces95 or @samhouts
@ianvink shneuvil at microsoft.com
We are getting this as well. Tried various combinations of switching the visual mode to default, or switching the underlying type from entry to editor and its only when the control type is editor and the visual is material that we experience the issue.
Just another piece of information on this. Tried hooking up to the text changed event - no change. Tried looking at the values at various points of the view life cycle and the "Text" property is always empty. Will revert back to using the default visual for the time being.
@Goksly Can you please attach a small project that demonstrates this issue? Thanks!
Just a simple project showing entry working as expected for default and material, and editor working as expected for default but not material. Note that, as per the purpose of this issue, it works fine on the simulator but not on a physical device.
To replicate, use the sliders to update the entry / editor values, and then amend the associated input control (values between 0 and 1). For all instances except the material editor the binding works as expected both ways. For the exception, slider updates the editor, editor doesn't update the slider.
WOOT! Confirmed.
Are you sure this is a error.... If you set the slider to Mode=TwoWay it works just fine.
Surely the Visual property shouldn't change the behaviour? It works fine with default... so why would I need to change the binding mode if I go with material (I've not tried it - just making a statement)...
Probably cause the default in material is oneway. either way it works in the Playground posted above.
Why is it with default you can do on appearing but with visual="material" it will crash the app... same issue different cupcake.
Hi all, got the same bug with Xamarin.Forms 4.0.
Adding Mode=TwoWay
at Text Binding also does not solve that.
When set Visual="Default"
for Editor that it works, but looking weird, means that it's not looking like we need
Any news for this issue, I am facing the same issue on IOS device
The bug remains in Xamarin.Forms 4.1.
Only works with Visual="Default", but it ruins the whole app experience.
I can't recreate on my physical devices so someone else will need to run with this one
@kingces95 ?
Any news on this issue - same happening with me on IPhone 7 with latest version of Xamarin.Forms and Material.
Observed this issue.
We have this bug too - still ain't fixed
Still happening in Xamarin Forms 4.2.0.709249
For me it works sometimes, perhaps 1 in 10. Have a Editor in a modal and checking the text for empty/null when saving. About 1/10 I have text in the binding. If I remove visual=material it works all the time. This is for iOS device.
Still happening in Xamarin Forms 4.2.0.709249
Same here.. this is very annoying :(
Still happening in Xamarin Forms 4.2.0.709249
Same here.. this is very annoying :(
Unable to have a coherent Material app. Don't people use forms?
@NunoBem if you use the Android X versions of the support libraries does that resolve?
https://devblogs.microsoft.com/xamarin/androidx-for-xamarin/
https://www.nuget.org/packages/Xamarin.Google.Android.Material/1.0.0-preview02
@NunoBem if you use the Android X versions of the support libraries does that resolve?
https://devblogs.microsoft.com/xamarin/androidx-for-xamarin/
https://www.nuget.org/packages/Xamarin.Google.Android.Material/1.0.0-preview02
@PureWeen That influence the IOS version? I will give it a try.
@NunoBem WAIT nm sorry I was thinking you were having this issue on Android :-/ Sorry about that
@PureWeen Ok no problem. This is a bug back from Xamarin Forms 3.6.0.220655 and Xamarin.Forms.Visual.Material on a physical IOS device.
A binding on a Editor doesn't work properly with Material Design.
I have the same issue on iOS (Xamarin.Forms 4.2.0.709249)
I can confirm that using Visual="Default" fixes the issue.
It's not just the binding, if I try to directly access the "Text" property, it is usually null or not updated, for example I could write abcdef and sometimes Text is null and other times is something like abc.
I can confirm that using Visual="Default" fixes the issue.
Me too, even without binding the problem is the same on iOS, if you set Visual="Default" everything woks fine
Same problem here.
As added info I can say that if behind code you try to take the 'text' value of the editor object, the return value is null (only when Visual=Material)
Seeing the same thing almost pulled my damn hair out, should have googled sooner! What really threw me off was that it works 100% fine on the SIMULATOR, just not on a physical iOS device.
Any ETA on a fix, or anyone have a suitable workaround in the meantime?
@PureWeen Any feedback for this?
Any updates where we are at for this?
For some reason none of these handlers are firing when this is deployed to a physical device
https://github.com/xamarin/Xamarin.Forms/blob/5d010511c6fc49fe185f010c17fa9249820ad3d2/Xamarin.Forms.Platform.iOS/Renderers/EditorRenderer.cs#L180
I tested a native Xamarin.IOS application and the events fire there so not sure yet why it's different for us :-/
For now this should fix
https://github.com/xamarin/Xamarin.Forms/pull/8011
Here's the root of the problem being investigated by the iOS team
https://github.com/xamarin/xamarin-macios/issues/7235
In the mean time if you want to fix this locally
That should stop the TextView from getting GC'd
closed by #8011
Most helpful comment
In the mean time if you want to fix this locally
[assembly: ExportRenderer(typeof(Xamarin.Forms.Editor), typeof(CustomEditorRenderer), new[] { typeof(VisualMarker.Material) })]
That should stop the TextView from getting GC'd