Skip to content

Some textual content causes horizontal bounce. #150

Description

@solocez

Library Version

v2.7

Description

I use MarkdownView to reflect textual content.
MarkdownView instance is placed within a ScrollView.

There is horizontal bounce effect appears based on textual content.
For example:

  • "Dkjdpokvjdpfvokjdspfkjsfpkjpkjspokj. D" causes bounce effect.
  • "Dkjdpokvjdpfvokjdspfkjsfpkjpkjspokj. D" no bounce effect.

Based on my research: horizontal bounce effect present when there is 1) a long textual word 2) two consequent spaces present .
Horizontal (or vertical) bounce becomes available when the content's reported size on that axis exceeds the scroll view's bounds on that axis — regardless of whether scrolling is enabled on that axis. So, seems long word + two consecuent spaces string cause some miscalculation.

Applying scrollBounceBehavior or/and fixedSize do not help.

Minimum reproducible code

ScrollView {
        VStack {
                ForEach(history ?? []) { entry in
                        MarkdownView(entry.text)
                }
        }
}

Raw markdown

Causes bounce effect:

Dkjdpokvjdpfvokjdspfkjsfpkjpkjspokj.  D

No bounce effect:

Dkjdpokvjdpfvokjdspfkjsfpkjpkjspokj. D
kjdpokvjdpfvokjdspfkjsfpkjpkjspokj.  D

Additional comments

No response

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