Skip to content

[BUG] SelectableHtml does not apply padding #1128

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

Closed
webhaikal opened this issue Aug 15, 2022 · 2 comments
Closed

[BUG] SelectableHtml does not apply padding #1128

webhaikal opened this issue Aug 15, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@webhaikal
Copy link

Describe the bug:
Padding does not get applied to elements in SelectableHtml. Tried both using a wildcard style and specific class, both does not work.

HTML to reproduce the issue:

<p class="p1 p3 c2" style="position:absolute;left:36.000px;top:67.280px;"><span class="c3 c4"> </span><span
                    class="c3 c4">“</span><span class="c3 c4">U</span><span class="c5">dinnn! Balikkk!</span><span
                    class="c5">”</span></p>
            <p class="p1 p3 c2" style="position:absolute;left:0;top:108.822px;"><bdi><span class="c5"
                        style="display:inline-block;overflow:hidden;width:36.000px;tab-size:360;">
                    </span></bdi><bdi><span class="c5">Pekik Saleha sambil matanya melilau mencari Udin. Sebelum azan
                        Maghrib </span></bdi></p>

Html widget configuration:

var style = Style.fromCss(
              book.content!.Css!.values.first.content!, (css, errors) => null);
style.addAll(
            {
              '*': Style(
                fontSize: fontSize,
                fontFamily: fontFamily(family),
                color: textColor(background),
              ),
              '.p4': Style(
                display: Display.INLINE,
              ),
              '.p3': Style(
                padding: const EdgeInsets.symmetric(
                  vertical: 12,
                ),
              ),
            },
          );

SelectableHtml(
                        shrinkWrap: true,
                        data: paragraphs[index].element.outerHtml,
                        onLinkTap: (href, _, __, ___) async =>
                            launchUrlString(href!),
);

Expected behavior:
Padding gets applied, this works if using normal Html widget.

Device details and Flutter/Dart/flutter_html versions:
Flutter 3.0, flutter_html 3.0.0-alpha05

@webhaikal webhaikal added the bug Something isn't working label Aug 15, 2022
@dragnev-dev
Copy link

dragnev-dev commented Aug 19, 2022

See docs#SelectableHtml
I suggest closing this in favor of #717.

@Sub6Resources
Copy link
Owner

Closing. Follow #717 for updates

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

No branches or pull requests

3 participants