Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a href with image #121

Closed
DagobertDokate opened this issue Jul 10, 2019 · 12 comments · Fixed by #122
Closed

a href with image #121

DagobertDokate opened this issue Jul 10, 2019 · 12 comments · Fixed by #122
Labels
bug Something isn't working
Milestone

Comments

@DagobertDokate
Copy link

DagobertDokate commented Jul 10, 2019

Good morning,

a image as a link is not clickable.
<a href="www.google.de"><img src="https://image.de"></a>

can you fix it? =)

kind regards

@DagobertDokate DagobertDokate changed the title a a href with image Jul 10, 2019
@The-Redhat
Copy link
Contributor

The-Redhat commented Jul 10, 2019

Hey can you please post your code of the Html Widget.

@Sub6Resources Sub6Resources added the more-info-needed More information is needed to resolve the issue. Will be closed if no response is received. label Jul 17, 2019
@DagobertDokate
Copy link
Author

Html( linkStyle: TextStyle(color: Colors.grey), data: deal.content, defaultTextStyle: Styles.BLACK_MEDIUM_16, onLinkTap: (url) => launch(url), ),

@AlastorReach
Copy link

Same problem here, a href with image when is clicked fires onImageTap event and not onLinkTap.

@Sub6Resources Sub6Resources added bug Something isn't working richtext-parser and removed more-info-needed More information is needed to resolve the issue. Will be closed if no response is received. labels Aug 21, 2019
@Sub6Resources
Copy link
Owner

Yup, this is definitely an issue. I'll work to make sure that the onLinkTap callback is preferred over the onImageTap in this case.

@masonzhang
Copy link

I have the same issue. Hopefully the fix can be released soon. Currently I'm using a complicated workaround. Thanks a lot!

@rayliverified
Copy link
Contributor

rayliverified commented Dec 6, 2019

This issue exists in the default parser as well as the RichText parser.

@Sub6Resources - this issue is really unfortunate because the current onImageTap callback only provides the image URL that is clicked. Often times, an image is used as a button or CTA and needs to open another URL. Would you consider prioritizing this issue?

Currently, the only workaround I can think of is adding the open url to a query parameter and extracting that value.

@Sub6Resources Sub6Resources added this to the 1.0.0 milestone Dec 17, 2019
@Sub6Resources
Copy link
Owner

This has been fixed in version 1.0.0 and will be released by the end of the month. See #122 for progress on the 1.0.0 release.

@Sub6Resources Sub6Resources mentioned this issue Dec 17, 2019
20 tasks
@Sub6Resources
Copy link
Owner

As a note, the fix makes it so that both of the callbacks (onImageTap and onLinkTap) are called.

@jhass
Copy link

jhass commented Feb 3, 2020

@Sub6Resources thanks for the fix! Is there a way to suppress onImageTap in this case? Alternatively is there a way to detect this case in onImageTap to suppress it there?

@Sub6Resources
Copy link
Owner

Sub6Resources commented Feb 3, 2020

Not currently, I may consider adding that though. What is your use-case for detecting onLinkTap and suppressing onImageTap?

@jhass
Copy link

jhass commented Feb 3, 2020

I have user content, namely I render parsed markdown content. Users sometimes embed images which I'd like to provide a lightbox for on tap. But sometimes users also wrap the image embed with a link for example for a link banner or a link to their own gallery page etc. In this case I want to open just the link and not show the lightbox.

@jhass
Copy link

jhass commented May 11, 2020

Guess I should open a new issue for the above so it doesn't get lost?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants