Search code examples
c#androidxamarinsyncfusion

SyncFusion SfRichTextEditor doesn't return edited text using Prism, Xamarin.Forms on Android


I am using Xamarin.Forms with Prism and the Syncfusion RichTextEditor component on an Android device. The issue I am having is that I can't seem to retrieve the edited text back in the view model. I have used a binding to the Text property, which is always null. I have tried to add an event handler for "TextChanged" event in the code behind - this event is never fired. I have attempted to call RichTextEditor.GetHtmlString() in the code behind too - which returns null.

The editor displays correctly in the app and all editing functionality(bold, italic etc.) seem to work just fine, however a warning in the output log shows:

[INFO:CONSOLE(1)] "Uncaught TypeError: jsBridge.invokeAction is not a function", source: (1)12-19 11:10:32.963 I/chromium(13310): [INFO:CONSOLE(1)] "Uncaught TypeError: jsBridge.invokeAction is not a function", source: (1)

Xamarin.Forms - 4.4.0.991265

Syncfusion.Xamarin.SfRichTextEditor - 17.4.0.39

Edit: Syncfusion support have provided an example where the modified text is correctly updated in the view model. The only visible difference is that it is using Unity not DryIoc. I have created a replica sample project using DryIoc and the updated text is still correctly being populated in the view model... must be something to do with the project setup!!


Solution

  • After removing all nugets and unrelated code from the solution my code still returned null when updating the text.

    Looking into the Android project setup vs the newly created sample solution I found that the "Dex Compiler" was set to D8 in my project but DX by default in both test solutions, changing that to DX fixed the issue... Text and HtmlText are now correctly being bound to the viewmodel and I can extract their values!