Skip to content

Iframe receiving null attributes when working with CustomRender #475

@JHBitencourt

Description

@JHBitencourt

Although the default iframe render works fine, both attributes and element parameters from CustomRender are aways null when using it with iframe:

Html(
  data:
      '<iframe src="/api/flow.js?q=https%3A%2F%2Fgoogle.com"></iframe>'
      '<iframe title="W3Schools Free Online Web Tutorials" src="/api/flow.js?q=https%3A%2F%2Fwww.w3schools.com%2Ftags%2Fdemo_iframe_sandbox.htm"></iframe>'
      '<iframe width="560" height="315" src="/api/flow.js?q=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmfokPqeSNcw" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',
  customRender: {
    'iframe' : (
        RenderContext context,
        Widget parsedChild,
        Map<String, String> attributes,
        dom.Element element,
    ) {
      print(element);
      print(attributes);
      return null;
    },
  }
)

flutter_html: ^1.1.1 and flutter_html: ^1.0.2

% fvm flutter doctor
FVM: Running version 1.22.2
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, 1.22.2, on Mac OS X 10.15.5 19F101, locale en-BR)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Chrome - develop for the web
[!] Android Studio (version 4.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Ultimate Edition (version 2019.2.4)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
[✓] Connected device (4 available)

This issue is similar to what #464 and #473 described, but I've opened a new one to be clear that the problem is when using iframe with CustomRender.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions