Closed dbard closed 4 years ago
@matteobortolazzo is this fixed? I have a bug in our app that neds fixing today, if there is a fix any chance of a beta or preview release today?
@IeuanWalker I cannot test it so I trust @dbard PR Now 4.1.3 is releasing
@matteobortolazzo thanks for releasing it so quickly. Unfortunately version 4.1.3 still doesn't work for me. I'm using a iOS 13.5 emulator.
I am sorry to head that!
Unfortunately I cannot work on that right now.
Can you please try version 5 (alpha) then?
@matteobortolazzo i can confirm link and phone numbers are working, but email link isn't. Also seams to have an issue with scrolling.
The control is wrapped in a scrollview, but is only scrollable when the view is refreshed with hot reload. Wasnt an issue on older versions
Got it, can add those issues as comments in pr #104 please?
@matteobortolazzo done. As i need this fixed my self are you ok with me messing around with that PR? cant promise anything though.
Sure, help is always welcome :) thanks
Note that the code I provided was meant to address that there was some unnecessary math being performed to determine total characters which wasn't necessary. It only addressed where on the screen a tap occurred, nothing to do with what happens within the library after the tap was correctly observed.
@dbard sure, don't worry, your update is still valid! Thanks again
@matteobortolazzo @dbard The scroll issue seams to happen if the html is set after the the page is loaded. In my project I have a markdown file embedded in the project, and in the OnAppearing of the page i read the file, and convert it too html, then set the text on HtmlLabel. I've replicated the issue here - https://github.com/IeuanWalker/HtmlLabelPlugin/tree/Bug/Scrollview
The scrollview works just text is cut off
And this is the error that I'm getting when clicking the email link (also replicated in the above repo)
2020-06-24 18:02:29.112257+0100 HtmlLabel.Forms.Plugin.Tests.App.iOS[62636:1277100] -canOpenURL: failed for URL: "mailto:" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
[0:] Specified method is not supported.: ERROR:
2020-06-24 18:02:29.121559+0100 HtmlLabel.Forms.Plugin.Tests.App.iOS[62636:1277258] [default] Failed to open URL mailto:github@github.com?subject=Awesome&body=Awesome%20plugin: Error Domain=NSOSStatusErrorDomain Code=-10814 "(null)" UserInfo={_LSLine=247, _LSFunction=-[_LSDOpenClient openURL:options:completionHandler:]}
@matteobortolazzo Update
I think the scrolling issue is do to this issue - https://github.com/xamarin/Xamarin.Forms/issues/1332
For now I've moved the method call from the OnAppearing
to the page constructor before the InitializeComponent();
call and all seams fine. Only reason it was in the OnAppearing
was because it was using async methods to handle error messages + PopAsync. But I've updated it so it catches the error in the constructor and in the OnAppearing
if the text is null then it show the error message and pops the page.
So only issue I have now is around email links, but its not going to stop us releasing with it not working. So ill stick to v5 alpha for now,
Got it, glad to hear. About emails, it looks like it is a Xamarin.Essentials
issue, do you need to whitelist emails in the Info.plist maybe?
EDIT: I think public static bool IsEmail(this Uri uri) => uri.MatchSchema("mailto")
is not returning True
, do you mind debug it please?
EDIT 2: Maybe I should have added Unit Tests for those extension methods.
@matteobortolazzo Ye sure ill give it a test in a bit
@matteobortolazzo
I use a simulator 90%, but turns out the Xamarin.Essentials email isn't supported on iOS simulators. From the docs - 'To use the Email API on iOS you must run it on a physical device, else an exception will be thrown.' https://docs.microsoft.com/en-us/xamarin/essentials/email?tabs=ios
Tested my project on a physical device and I'm getting a 'NullReferenceException' when clicking on an email link. I've imported the HtmlLabel project into mine (so I don't have to create provisioning profile to test on a physical device) and its throwing the error here -
Updating the code to this fixes it - Do you reckon you could do a another Alpha release with this fix today?
@matteobortolazzo PR created - #108
v5 Released
If the user taps on a link appearing after the first line of a multiple line label, the link doesn't open. I was able to reproduce this using the test project with the Nuget.
I've put up a pull request with what I think is a good solution. https://github.com/matteobortolazzo/HtmlLabelPlugin/pull/105
And... thank you for your work on this Nuget!!