Skip to content

Conversation

tneotia
Copy link
Contributor

@tneotia tneotia commented Feb 13, 2021

Fixes #301 using code:

onImageTap: (src, context, attributes, element) {
   if (element.parent.localName != "a") {
      print(src); 
      //whatever else here
   }
},

Maybe providing all those parameters in the OnTap function is too much, so if you disagree then I can try and figure out an alternate way. I thought this would be the best solution since it allows the user to customize down to the lowest level using the same parameters the widgets themselves are built with.

@@ -82,7 +83,16 @@ class ImageContentElement extends ReplacedElement {
if (entry.key.call(attributes, element)) {
final widget = entry.value.call(context, attributes, element);
if (widget != null) {
return widget;
return RawGestureDetector(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm did we introduce a regression bug where the onImageTap listener was never called?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, from when you implemented the image renders.

@erickok erickok merged commit b5c5ea0 into Sub6Resources:master Feb 24, 2021
tneotia added a commit to tneotia/flutter_html that referenced this pull request Feb 24, 2021
erickok added a commit that referenced this pull request Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to suppress onImageTap for linked images.
2 participants